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

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

Pull pin control updates from Linus Walleij:
"We have some patches to DTS[I] files in arm and arm64 as well, that
were merged here as DT headers were being changed.

The most interesting stuff is the Intel Tangier chip support and
AMLogic C3 in my opinion.

No core changes this time.

Drivers:

- Intel Tangier SoC pin control support

- AMLogic C3 SoC pin control support

- Texas Instruments AM654 SoC pin control support

- Qualcomm SM8350 and SM6115 LPASS (Low Power Audio Sub-System) pin
control support

- Qualcomm PMX75 and PM7550BA (Power Management) pin control support

- Qualcomm PMC8180 and PMC8180C (Power Management) pin control
support

- DROP the Oxnas driver as there is not enough of community interest
to keep carrying this ARM(11) port

Enhancements:

- Bias control in the MT7986 pin control driver

- Misc device tree binding enhancements such as the Broadcom 11351
being converted to YAML

- New macro: DEFINE_NOIRQ_DEV_PM_OPS() put to use

- Clean up some SPDX headers

- Handle non-unique devicetree subnode names in two Renesas drivers"

* tag 'pinctrl-v6.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (80 commits)
pinctrl: mlxbf3: Remove gpio_disable_free()
pinctrl: use capital "OR" for multiple licenses in SPDX
dt-bindings: pinctrl: renesas,rza2: Use 'additionalProperties' for child nodes
pinctrl: cherryview: fix address_space_handler() argument
pinctrl: intel: consolidate ACPI dependency
pinctrl: tegra: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper
pinctrl: renesas: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper
pinctrl: mvebu: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper
pinctrl: at91: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper
pinctrl: cherryview: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper
pm: Introduce DEFINE_NOIRQ_DEV_PM_OPS() helper
pinctrl: mediatek: assign functions to configure pin bias on MT7986
pinctrl: mediatek: fix pull_type data for MT7981
dt-bindings: pinctrl: aspeed: Allow only defined pin mux node properties
dt-bindings: pinctrl: Drop 'phandle' properties
pinctrl: lynxpoint: Make use of pm_ptr()
pinctrl: baytrail: Make use of pm_ptr()
pinctrl: intel: Switch to use exported namespace
pinctrl: lynxpoint: reuse common functions from pinctrl-intel
pinctrl: cherryview: reuse common functions from pinctrl-intel
...

+3868 -4297
+1 -1
Documentation/devicetree/bindings/arm/omap/ctrl.txt
··· 8 8 9 9 See [2] for documentation about clock/clockdomain nodes. 10 10 11 - [1] Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt 11 + [1] Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml 12 12 [2] Documentation/devicetree/bindings/clock/ti/* 13 13 14 14 Required properties:
-47
Documentation/devicetree/bindings/gpio/gpio_oxnas.txt
··· 1 - * Oxford Semiconductor OXNAS SoC GPIO Controller 2 - 3 - Please refer to gpio.txt for generic information regarding GPIO bindings. 4 - 5 - Required properties: 6 - - compatible: "oxsemi,ox810se-gpio" or "oxsemi,ox820-gpio" 7 - - reg: Base address and length for the device. 8 - - interrupts: The port interrupt shared by all pins. 9 - - gpio-controller: Marks the port as GPIO controller. 10 - - #gpio-cells: Two. The first cell is the pin number and 11 - the second cell is used to specify the gpio polarity as defined in 12 - defined in <dt-bindings/gpio/gpio.h>: 13 - 0 = GPIO_ACTIVE_HIGH 14 - 1 = GPIO_ACTIVE_LOW 15 - - interrupt-controller: Marks the device node as an interrupt controller. 16 - - #interrupt-cells: Two. The first cell is the GPIO number and second cell 17 - is used to specify the trigger type as defined in 18 - <dt-bindings/interrupt-controller/irq.h>: 19 - IRQ_TYPE_EDGE_RISING 20 - IRQ_TYPE_EDGE_FALLING 21 - IRQ_TYPE_EDGE_BOTH 22 - - gpio-ranges: Interaction with the PINCTRL subsystem, it also specifies the 23 - gpio base and count, should be in the format of numeric-gpio-range as 24 - specified in the gpio.txt file. 25 - 26 - Example: 27 - 28 - gpio0: gpio@0 { 29 - compatible = "oxsemi,ox810se-gpio"; 30 - reg = <0x000000 0x100000>; 31 - interrupts = <21>; 32 - #gpio-cells = <2>; 33 - gpio-controller; 34 - interrupt-controller; 35 - #interrupt-cells = <2>; 36 - gpio-ranges = <&pinctrl 0 0 32>; 37 - }; 38 - 39 - keys { 40 - ... 41 - 42 - button-esc { 43 - label = "ESC"; 44 - linux,code = <1>; 45 - gpios = <&gpio0 12 0>; 46 - }; 47 - };
+5
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
··· 15 15 properties: 16 16 compatible: 17 17 enum: 18 + - amlogic,c3-periphs-pinctrl 18 19 - amlogic,meson-a1-periphs-pinctrl 19 20 - amlogic,meson-s4-periphs-pinctrl 20 21 ··· 36 35 items: 37 36 - const: mux 38 37 - const: gpio 38 + 39 + gpio-line-names: 40 + minItems: 62 # A1 41 + maxItems: 82 # S4 39 42 40 43 unevaluatedProperties: 41 44 type: object
+7
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml
··· 41 41 gpio-ranges: 42 42 maxItems: 1 43 43 44 + patternProperties: 45 + "^.+-hog(-[0-9]+)?$": 46 + type: object 47 + 48 + required: 49 + - gpio-hog 50 + 44 51 required: 45 52 - reg 46 53 - reg-names
+3
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-g12a-aobus.yaml
··· 36 36 - const: ds 37 37 - const: gpio 38 38 39 + gpio-line-names: 40 + maxItems: 15 41 + 39 42 unevaluatedProperties: 40 43 type: object 41 44 $ref: amlogic,meson-pinctrl-common.yaml#/$defs/meson-pins
+3
Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-g12a-periphs.yaml
··· 38 38 - const: mux 39 39 - const: ds 40 40 41 + gpio-line-names: 42 + maxItems: 85 43 + 41 44 unevaluatedProperties: 42 45 type: object 43 46 $ref: amlogic,meson-pinctrl-common.yaml#/$defs/meson-pins
+4
Documentation/devicetree/bindings/pinctrl/amlogic,meson8-pinctrl-aobus.yaml
··· 44 44 - const: pull 45 45 - const: gpio 46 46 47 + gpio-line-names: 48 + minItems: 11 # GXL 49 + maxItems: 16 # Meson8 50 + 47 51 unevaluatedProperties: 48 52 type: object 49 53 $ref: amlogic,meson-pinctrl-common.yaml#/$defs/meson-pins
+4
Documentation/devicetree/bindings/pinctrl/amlogic,meson8-pinctrl-cbus.yaml
··· 45 45 - const: pull-enable 46 46 - const: gpio 47 47 48 + gpio-line-names: 49 + minItems: 86 # AXG 50 + maxItems: 120 # Meson8 51 + 48 52 unevaluatedProperties: 49 53 type: object 50 54 $ref: amlogic,meson-pinctrl-common.yaml#/$defs/meson-pins
+26 -26
Documentation/devicetree/bindings/pinctrl/aspeed,ast2400-pinctrl.yaml
··· 25 25 reg: 26 26 maxItems: 2 27 27 28 - patternProperties: 29 - '^.*$': 30 - if: 31 - type: object 32 - then: 33 - patternProperties: 34 - "^function|groups$": 35 - $ref: /schemas/types.yaml#/definitions/string 36 - enum: [ ACPI, ADC0, ADC1, ADC10, ADC11, ADC12, ADC13, ADC14, ADC15, 37 - ADC2, ADC3, ADC4, ADC5, ADC6, ADC7, ADC8, ADC9, BMCINT, DDCCLK, DDCDAT, 38 - EXTRST, FLACK, FLBUSY, FLWP, GPID, GPID0, GPID2, GPID4, GPID6, GPIE0, 39 - GPIE2, GPIE4, GPIE6, I2C10, I2C11, I2C12, I2C13, I2C14, I2C3, I2C4, 40 - I2C5, I2C6, I2C7, I2C8, I2C9, LPCPD, LPCPME, LPCRST, LPCSMI, MAC1LINK, 41 - MAC2LINK, MDIO1, MDIO2, NCTS1, NCTS2, NCTS3, NCTS4, NDCD1, NDCD2, 42 - NDCD3, NDCD4, NDSR1, NDSR2, NDSR3, NDSR4, NDTR1, NDTR2, NDTR3, NDTR4, 43 - NDTS4, NRI1, NRI2, NRI3, NRI4, NRTS1, NRTS2, NRTS3, OSCCLK, PWM0, 44 - PWM1, PWM2, PWM3, PWM4, PWM5, PWM6, PWM7, RGMII1, RGMII2, RMII1, 45 - RMII2, ROM16, ROM8, ROMCS1, ROMCS2, ROMCS3, ROMCS4, RXD1, RXD2, RXD3, 46 - RXD4, SALT1, SALT2, SALT3, SALT4, SD1, SD2, SGPMCK, SGPMI, SGPMLD, 47 - SGPMO, SGPSCK, SGPSI0, SGPSI1, SGPSLD, SIOONCTRL, SIOPBI, SIOPBO, 48 - SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, SPI1DEBUG, SPI1PASSTHRU, 49 - SPICS1, TIMER3, TIMER4, TIMER5, TIMER6, TIMER7, TIMER8, TXD1, TXD2, 50 - TXD3, TXD4, UART6, USB11D1, USB11H2, USB2D1, USB2H1, USBCKI, VGABIOS_ROM, 51 - VGAHS, VGAVS, VPI18, VPI24, VPI30, VPO12, VPO24, WDTRST1, WDTRST2] 28 + additionalProperties: 29 + $ref: pinmux-node.yaml# 30 + additionalProperties: false 31 + 32 + properties: 33 + pins: true 34 + bias-disable: true 35 + 36 + patternProperties: 37 + "^function|groups$": 38 + enum: [ ACPI, ADC0, ADC1, ADC10, ADC11, ADC12, ADC13, ADC14, ADC15, 39 + ADC2, ADC3, ADC4, ADC5, ADC6, ADC7, ADC8, ADC9, BMCINT, DDCCLK, DDCDAT, 40 + EXTRST, FLACK, FLBUSY, FLWP, GPID, GPID0, GPID2, GPID4, GPID6, GPIE0, 41 + GPIE2, GPIE4, GPIE6, I2C10, I2C11, I2C12, I2C13, I2C14, I2C3, I2C4, 42 + I2C5, I2C6, I2C7, I2C8, I2C9, LPCPD, LPCPME, LPCRST, LPCSMI, MAC1LINK, 43 + MAC2LINK, MDIO1, MDIO2, NCTS1, NCTS2, NCTS3, NCTS4, NDCD1, NDCD2, 44 + NDCD3, NDCD4, NDSR1, NDSR2, NDSR3, NDSR4, NDTR1, NDTR2, NDTR3, NDTR4, 45 + NDTS4, NRI1, NRI2, NRI3, NRI4, NRTS1, NRTS2, NRTS3, OSCCLK, PWM0, 46 + PWM1, PWM2, PWM3, PWM4, PWM5, PWM6, PWM7, RGMII1, RGMII2, RMII1, 47 + RMII2, ROM16, ROM8, ROMCS1, ROMCS2, ROMCS3, ROMCS4, RXD1, RXD2, RXD3, 48 + RXD4, SALT1, SALT2, SALT3, SALT4, SD1, SD2, SGPMCK, SGPMI, SGPMLD, 49 + SGPMO, SGPSCK, SGPSI0, SGPSI1, SGPSLD, SIOONCTRL, SIOPBI, SIOPBO, 50 + SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, SPI1DEBUG, SPI1PASSTHRU, 51 + SPICS1, TIMER3, TIMER4, TIMER5, TIMER6, TIMER7, TIMER8, TXD1, TXD2, 52 + TXD3, TXD4, UART6, USB11D1, USB11H2, USB2D1, USB2H1, USBCKI, VGABIOS_ROM, 53 + VGAHS, VGAVS, VPI18, VPI24, VPI30, VPO12, VPO24, WDTRST1, WDTRST2] 52 54 53 55 allOf: 54 56 - $ref: pinctrl.yaml# 55 57 56 58 required: 57 59 - compatible 58 - 59 - additionalProperties: false 60 60 61 61 examples: 62 62 - |
+28 -28
Documentation/devicetree/bindings/pinctrl/aspeed,ast2500-pinctrl.yaml
··· 37 37 0: compatible with "aspeed,ast2500-gfx", "syscon" 38 38 1: compatible with "aspeed,ast2500-lhc", "syscon" 39 39 40 - patternProperties: 41 - '^.*$': 42 - if: 43 - type: object 44 - then: 45 - patternProperties: 46 - "^function|groups$": 47 - $ref: /schemas/types.yaml#/definitions/string 48 - enum: [ ACPI, ADC0, ADC1, ADC10, ADC11, ADC12, ADC13, ADC14, ADC15, 49 - ADC2, ADC3, ADC4, ADC5, ADC6, ADC7, ADC8, ADC9, BMCINT, DDCCLK, DDCDAT, 50 - ESPI, FWSPICS1, FWSPICS2, GPID0, GPID2, GPID4, GPID6, GPIE0, GPIE2, 51 - GPIE4, GPIE6, I2C10, I2C11, I2C12, I2C13, I2C14, I2C3, I2C4, I2C5, 52 - I2C6, I2C7, I2C8, I2C9, LAD0, LAD1, LAD2, LAD3, LCLK, LFRAME, LPCHC, 53 - LPCPD, LPCPLUS, LPCPME, LPCRST, LPCSMI, LSIRQ, MAC1LINK, MAC2LINK, 54 - MDIO1, MDIO2, NCTS1, NCTS2, NCTS3, NCTS4, NDCD1, NDCD2, NDCD3, NDCD4, 55 - NDSR1, NDSR2, NDSR3, NDSR4, NDTR1, NDTR2, NDTR3, NDTR4, NRI1, NRI2, 56 - NRI3, NRI4, NRTS1, NRTS2, NRTS3, NRTS4, OSCCLK, PEWAKE, PNOR, PWM0, 57 - PWM1, PWM2, PWM3, PWM4, PWM5, PWM6, PWM7, RGMII1, RGMII2, RMII1, 58 - RMII2, RXD1, RXD2, RXD3, RXD4, SALT1, SALT10, SALT11, SALT12, SALT13, 59 - SALT14, SALT2, SALT3, SALT4, SALT5, SALT6, SALT7, SALT8, SALT9, SCL1, 60 - SCL2, SD1, SD2, SDA1, SDA2, SGPS1, SGPS2, SIOONCTRL, SIOPBI, SIOPBO, 61 - SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, SPI1CS1, SPI1DEBUG, 62 - SPI1PASSTHRU, SPI2CK, SPI2CS0, SPI2CS1, SPI2MISO, SPI2MOSI, TIMER3, 63 - TIMER4, TIMER5, TIMER6, TIMER7, TIMER8, TXD1, TXD2, TXD3, TXD4, UART6, 64 - USB11BHID, USB2AD, USB2AH, USB2BD, USB2BH, USBCKI, VGABIOSROM, VGAHS, 65 - VGAVS, VPI24, VPO, WDTRST1, WDTRST2] 40 + additionalProperties: 41 + $ref: pinmux-node.yaml# 42 + additionalProperties: false 43 + 44 + properties: 45 + pins: true 46 + bias-disable: true 47 + 48 + patternProperties: 49 + "^function|groups$": 50 + enum: [ ACPI, ADC0, ADC1, ADC10, ADC11, ADC12, ADC13, ADC14, ADC15, 51 + ADC2, ADC3, ADC4, ADC5, ADC6, ADC7, ADC8, ADC9, BMCINT, DDCCLK, DDCDAT, 52 + ESPI, FWSPICS1, FWSPICS2, GPID0, GPID2, GPID4, GPID6, GPIE0, GPIE2, 53 + GPIE4, GPIE6, I2C10, I2C11, I2C12, I2C13, I2C14, I2C3, I2C4, I2C5, 54 + I2C6, I2C7, I2C8, I2C9, LAD0, LAD1, LAD2, LAD3, LCLK, LFRAME, LPCHC, 55 + LPCPD, LPCPLUS, LPCPME, LPCRST, LPCSMI, LSIRQ, MAC1LINK, MAC2LINK, 56 + MDIO1, MDIO2, NCTS1, NCTS2, NCTS3, NCTS4, NDCD1, NDCD2, NDCD3, NDCD4, 57 + NDSR1, NDSR2, NDSR3, NDSR4, NDTR1, NDTR2, NDTR3, NDTR4, NRI1, NRI2, 58 + NRI3, NRI4, NRTS1, NRTS2, NRTS3, NRTS4, OSCCLK, PEWAKE, PNOR, PWM0, 59 + PWM1, PWM2, PWM3, PWM4, PWM5, PWM6, PWM7, RGMII1, RGMII2, RMII1, 60 + RMII2, RXD1, RXD2, RXD3, RXD4, SALT1, SALT10, SALT11, SALT12, SALT13, 61 + SALT14, SALT2, SALT3, SALT4, SALT5, SALT6, SALT7, SALT8, SALT9, SCL1, 62 + SCL2, SD1, SD2, SDA1, SDA2, SGPS1, SGPS2, SIOONCTRL, SIOPBI, SIOPBO, 63 + SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, SPI1CS1, SPI1DEBUG, 64 + SPI1PASSTHRU, SPI2CK, SPI2CS0, SPI2CS1, SPI2MISO, SPI2MOSI, TIMER3, 65 + TIMER4, TIMER5, TIMER6, TIMER7, TIMER8, TXD1, TXD2, TXD3, TXD4, UART6, 66 + USB11BHID, USB2AD, USB2AH, USB2BD, USB2BH, USBCKI, VGABIOSROM, VGAHS, 67 + VGAVS, VPI24, VPO, WDTRST1, WDTRST2] 66 68 67 69 allOf: 68 70 - $ref: pinctrl.yaml# ··· 72 70 required: 73 71 - compatible 74 72 - aspeed,external-nodes 75 - 76 - additionalProperties: false 77 73 78 74 examples: 79 75 - |
+58 -60
Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml
··· 23 23 compatible: 24 24 const: aspeed,ast2600-pinctrl 25 25 26 - patternProperties: 27 - '^.*$': 28 - if: 29 - type: object 30 - then: 31 - properties: 32 - function: 33 - $ref: /schemas/types.yaml#/definitions/string 34 - enum: [ ADC0, ADC1, ADC10, ADC11, ADC12, ADC13, ADC14, ADC15, ADC2, 35 - ADC3, ADC4, ADC5, ADC6, ADC7, ADC8, ADC9, BMCINT, EMMC, ESPI, ESPIALT, 36 - FSI1, FSI2, FWQSPI, FWSPIABR, FWSPID, FWSPIWP, GPIT0, GPIT1, GPIT2, GPIT3, 37 - GPIT4, GPIT5, GPIT6, GPIT7, GPIU0, GPIU1, GPIU2, GPIU3, GPIU4, GPIU5, 38 - GPIU6, GPIU7, I2C1, I2C10, I2C11, I2C12, I2C13, I2C14, I2C15, I2C16, 39 - I2C2, I2C3, I2C4, I2C5, I2C6, I2C7, I2C8, I2C9, I3C3, I3C4, I3C5, 40 - I3C6, JTAGM, LHPD, LHSIRQ, LPC, LPCHC, LPCPD, LPCPME, LPCSMI, LSIRQ, 41 - MACLINK1, MACLINK2, MACLINK3, MACLINK4, MDIO1, MDIO2, MDIO3, MDIO4, 42 - NCTS1, NCTS2, NCTS3, NCTS4, NDCD1, NDCD2, NDCD3, NDCD4, NDSR1, NDSR2, 43 - NDSR3, NDSR4, NDTR1, NDTR2, NDTR3, NDTR4, NRI1, NRI2, NRI3, NRI4, 44 - NRTS1, NRTS2, NRTS3, NRTS4, OSCCLK, PEWAKE, PWM0, PWM1, PWM10, PWM11, 45 - PWM12, PWM13, PWM14, PWM15, PWM2, PWM3, PWM4, PWM5, PWM6, PWM7, PWM8, 46 - PWM9, RGMII1, RGMII2, RGMII3, RGMII4, RMII1, RMII2, RMII3, RMII4, 47 - RXD1, RXD2, RXD3, RXD4, SALT1, SALT10, SALT11, SALT12, SALT13, SALT14, 48 - SALT15, SALT16, SALT2, SALT3, SALT4, SALT5, SALT6, SALT7, SALT8, 49 - SALT9, SD1, SD2, SGPM1, SGPM2, SGPS1, SGPS2, SIOONCTRL, SIOPBI, SIOPBO, 50 - SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, SPI1ABR, SPI1CS1, SPI1WP, SPI2, 51 - SPI2CS1, SPI2CS2, TACH0, TACH1, TACH10, TACH11, TACH12, TACH13, TACH14, 52 - TACH15, TACH2, TACH3, TACH4, TACH5, TACH6, TACH7, TACH8, TACH9, THRU0, 53 - THRU1, THRU2, THRU3, TXD1, TXD2, TXD3, TXD4, UART10, UART11, UART12, 54 - UART13, UART6, UART7, UART8, UART9, USBAD, USBADP, USB2AH, USB2AHP, 55 - USB2BD, USB2BH, VB, VGAHS, VGAVS, WDTRST1, WDTRST2, WDTRST3, WDTRST4 ] 26 + additionalProperties: 27 + $ref: pinmux-node.yaml# 28 + additionalProperties: false 56 29 57 - groups: 58 - $ref: /schemas/types.yaml#/definitions/string 59 - enum: [ ADC0, ADC1, ADC10, ADC11, ADC12, ADC13, ADC14, ADC15, ADC2, 60 - ADC3, ADC4, ADC5, ADC6, ADC7, ADC8, ADC9, BMCINT, EMMCG1, EMMCG4, 61 - EMMCG8, ESPI, ESPIALT, FSI1, FSI2, FWQSPI, FWSPIABR, FWSPID, FWSPIWP, 62 - GPIT0, GPIT1, GPIT2, GPIT3, GPIT4, GPIT5, GPIT6, GPIT7, GPIU0, GPIU1, 63 - GPIU2, GPIU3, GPIU4, GPIU5, GPIU6, GPIU7, HVI3C3, HVI3C4, I2C1, I2C10, 64 - I2C11, I2C12, I2C13, I2C14, I2C15, I2C16, I2C2, I2C3, I2C4, I2C5, 65 - I2C6, I2C7, I2C8, I2C9, I3C3, I3C4, I3C5, I3C6, JTAGM, LHPD, LHSIRQ, 66 - LPC, LPCHC, LPCPD, LPCPME, LPCSMI, LSIRQ, MACLINK1, MACLINK2, MACLINK3, 67 - MACLINK4, MDIO1, MDIO2, MDIO3, MDIO4, NCTS1, NCTS2, NCTS3, NCTS4, 68 - NDCD1, NDCD2, NDCD3, NDCD4, NDSR1, NDSR2, NDSR3, NDSR4, NDTR1, NDTR2, 69 - NDTR3, NDTR4, NRI1, NRI2, NRI3, NRI4, NRTS1, NRTS2, NRTS3, NRTS4, 70 - OSCCLK, PEWAKE, PWM0, PWM1, PWM10G0, PWM10G1, PWM11G0, PWM11G1, PWM12G0, 71 - PWM12G1, PWM13G0, PWM13G1, PWM14G0, PWM14G1, PWM15G0, PWM15G1, PWM2, 72 - PWM3, PWM4, PWM5, PWM6, PWM7, PWM8G0, PWM8G1, PWM9G0, PWM9G1, QSPI1, 73 - QSPI2, RGMII1, RGMII2, RGMII3, RGMII4, RMII1, RMII2, RMII3, RMII4, 74 - RXD1, RXD2, RXD3, RXD4, SALT1, SALT10G0, SALT10G1, SALT11G0, SALT11G1, 75 - SALT12G0, SALT12G1, SALT13G0, SALT13G1, SALT14G0, SALT14G1, SALT15G0, 76 - SALT15G1, SALT16G0, SALT16G1, SALT2, SALT3, SALT4, SALT5, SALT6, 77 - SALT7, SALT8, SALT9G0, SALT9G1, SD1, SD2, SD3, SGPM1, SGPM2, SGPS1, SGPS2, 78 - SIOONCTRL, SIOPBI, SIOPBO, SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, 79 - SPI1ABR, SPI1CS1, SPI1WP, SPI2, SPI2CS1, SPI2CS2, TACH0, TACH1, TACH10, TACH11, 80 - TACH12, TACH13, TACH14, TACH15, TACH2, TACH3, TACH4, TACH5, TACH6, 81 - TACH7, TACH8, TACH9, THRU0, THRU1, THRU2, THRU3, TXD1, TXD2, TXD3, 82 - TXD4, UART10, UART11, UART12G0, UART12G1, UART13G0, UART13G1, UART6, 83 - UART7, UART8, UART9, USBA, USBB, VB, VGAHS, VGAVS, WDTRST1, WDTRST2, 84 - WDTRST3, WDTRST4] 30 + properties: 31 + function: 32 + enum: [ ADC0, ADC1, ADC10, ADC11, ADC12, ADC13, ADC14, ADC15, ADC2, 33 + ADC3, ADC4, ADC5, ADC6, ADC7, ADC8, ADC9, BMCINT, EMMC, ESPI, ESPIALT, 34 + FSI1, FSI2, FWQSPI, FWSPIABR, FWSPID, FWSPIWP, GPIT0, GPIT1, GPIT2, GPIT3, 35 + GPIT4, GPIT5, GPIT6, GPIT7, GPIU0, GPIU1, GPIU2, GPIU3, GPIU4, GPIU5, 36 + GPIU6, GPIU7, I2C1, I2C10, I2C11, I2C12, I2C13, I2C14, I2C15, I2C16, 37 + I2C2, I2C3, I2C4, I2C5, I2C6, I2C7, I2C8, I2C9, I3C3, I3C4, I3C5, 38 + I3C6, JTAGM, LHPD, LHSIRQ, LPC, LPCHC, LPCPD, LPCPME, LPCSMI, LSIRQ, 39 + MACLINK1, MACLINK2, MACLINK3, MACLINK4, MDIO1, MDIO2, MDIO3, MDIO4, 40 + NCTS1, NCTS2, NCTS3, NCTS4, NDCD1, NDCD2, NDCD3, NDCD4, NDSR1, NDSR2, 41 + NDSR3, NDSR4, NDTR1, NDTR2, NDTR3, NDTR4, NRI1, NRI2, NRI3, NRI4, 42 + NRTS1, NRTS2, NRTS3, NRTS4, OSCCLK, PEWAKE, PWM0, PWM1, PWM10, PWM11, 43 + PWM12, PWM13, PWM14, PWM15, PWM2, PWM3, PWM4, PWM5, PWM6, PWM7, PWM8, 44 + PWM9, RGMII1, RGMII2, RGMII3, RGMII4, RMII1, RMII2, RMII3, RMII4, 45 + RXD1, RXD2, RXD3, RXD4, SALT1, SALT10, SALT11, SALT12, SALT13, SALT14, 46 + SALT15, SALT16, SALT2, SALT3, SALT4, SALT5, SALT6, SALT7, SALT8, 47 + SALT9, SD1, SD2, SGPM1, SGPM2, SGPS1, SGPS2, SIOONCTRL, SIOPBI, SIOPBO, 48 + SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, SPI1ABR, SPI1CS1, SPI1WP, SPI2, 49 + SPI2CS1, SPI2CS2, TACH0, TACH1, TACH10, TACH11, TACH12, TACH13, TACH14, 50 + TACH15, TACH2, TACH3, TACH4, TACH5, TACH6, TACH7, TACH8, TACH9, THRU0, 51 + THRU1, THRU2, THRU3, TXD1, TXD2, TXD3, TXD4, UART10, UART11, UART12, 52 + UART13, UART6, UART7, UART8, UART9, USBAD, USBADP, USB2AH, USB2AHP, 53 + USB2BD, USB2BH, VB, VGAHS, VGAVS, WDTRST1, WDTRST2, WDTRST3, WDTRST4 ] 54 + 55 + groups: 56 + enum: [ ADC0, ADC1, ADC10, ADC11, ADC12, ADC13, ADC14, ADC15, ADC2, 57 + ADC3, ADC4, ADC5, ADC6, ADC7, ADC8, ADC9, BMCINT, EMMCG1, EMMCG4, 58 + EMMCG8, ESPI, ESPIALT, FSI1, FSI2, FWQSPI, FWSPIABR, FWSPID, FWSPIWP, 59 + GPIT0, GPIT1, GPIT2, GPIT3, GPIT4, GPIT5, GPIT6, GPIT7, GPIU0, GPIU1, 60 + GPIU2, GPIU3, GPIU4, GPIU5, GPIU6, GPIU7, HVI3C3, HVI3C4, I2C1, I2C10, 61 + I2C11, I2C12, I2C13, I2C14, I2C15, I2C16, I2C2, I2C3, I2C4, I2C5, 62 + I2C6, I2C7, I2C8, I2C9, I3C3, I3C4, I3C5, I3C6, JTAGM, LHPD, LHSIRQ, 63 + LPC, LPCHC, LPCPD, LPCPME, LPCSMI, LSIRQ, MACLINK1, MACLINK2, MACLINK3, 64 + MACLINK4, MDIO1, MDIO2, MDIO3, MDIO4, NCTS1, NCTS2, NCTS3, NCTS4, 65 + NDCD1, NDCD2, NDCD3, NDCD4, NDSR1, NDSR2, NDSR3, NDSR4, NDTR1, NDTR2, 66 + NDTR3, NDTR4, NRI1, NRI2, NRI3, NRI4, NRTS1, NRTS2, NRTS3, NRTS4, 67 + OSCCLK, PEWAKE, PWM0, PWM1, PWM10G0, PWM10G1, PWM11G0, PWM11G1, PWM12G0, 68 + PWM12G1, PWM13G0, PWM13G1, PWM14G0, PWM14G1, PWM15G0, PWM15G1, PWM2, 69 + PWM3, PWM4, PWM5, PWM6, PWM7, PWM8G0, PWM8G1, PWM9G0, PWM9G1, QSPI1, 70 + QSPI2, RGMII1, RGMII2, RGMII3, RGMII4, RMII1, RMII2, RMII3, RMII4, 71 + RXD1, RXD2, RXD3, RXD4, SALT1, SALT10G0, SALT10G1, SALT11G0, SALT11G1, 72 + SALT12G0, SALT12G1, SALT13G0, SALT13G1, SALT14G0, SALT14G1, SALT15G0, 73 + SALT15G1, SALT16G0, SALT16G1, SALT2, SALT3, SALT4, SALT5, SALT6, 74 + SALT7, SALT8, SALT9G0, SALT9G1, SD1, SD2, SD3, SGPM1, SGPM2, SGPS1, SGPS2, 75 + SIOONCTRL, SIOPBI, SIOPBO, SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, 76 + SPI1ABR, SPI1CS1, SPI1WP, SPI2, SPI2CS1, SPI2CS2, TACH0, TACH1, TACH10, TACH11, 77 + TACH12, TACH13, TACH14, TACH15, TACH2, TACH3, TACH4, TACH5, TACH6, 78 + TACH7, TACH8, TACH9, THRU0, THRU1, THRU2, THRU3, TXD1, TXD2, TXD3, 79 + TXD4, UART10, UART11, UART12G0, UART12G1, UART13G0, UART13G1, UART6, 80 + UART7, UART8, UART9, USBA, USBB, VB, VGAHS, VGAVS, WDTRST1, WDTRST2, 81 + WDTRST3, WDTRST4] 82 + 83 + pins: true 84 + bias-disable: true 85 85 86 86 allOf: 87 87 - $ref: pinctrl.yaml# 88 88 89 89 required: 90 90 - compatible 91 - 92 - additionalProperties: false 93 91 94 92 examples: 95 93 - |
-461
Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt
··· 1 - Broadcom BCM281xx Pin Controller 2 - 3 - This is a pin controller for the Broadcom BCM281xx SoC family, which includes 4 - BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. 5 - 6 - === Pin Controller Node === 7 - 8 - Required Properties: 9 - 10 - - compatible: Must be "brcm,bcm11351-pinctrl" 11 - - reg: Base address of the PAD Controller register block and the size 12 - of the block. 13 - 14 - For example, the following is the bare minimum node: 15 - 16 - pinctrl@35004800 { 17 - compatible = "brcm,bcm11351-pinctrl"; 18 - reg = <0x35004800 0x430>; 19 - }; 20 - 21 - As a pin controller device, in addition to the required properties, this node 22 - should also contain the pin configuration nodes that client devices reference, 23 - if any. 24 - 25 - === Pin Configuration Node === 26 - 27 - Each pin configuration node is a sub-node of the pin controller node and is a 28 - container of an arbitrary number of subnodes, called pin group nodes in this 29 - document. 30 - 31 - Please refer to the pinctrl-bindings.txt in this directory for details of the 32 - common pinctrl bindings used by client devices, including the definition of a 33 - "pin configuration node". 34 - 35 - === Pin Group Node === 36 - 37 - A pin group node specifies the desired pin mux and/or pin configuration for an 38 - arbitrary number of pins. The name of the pin group node is optional and not 39 - used. 40 - 41 - A pin group node only affects the properties specified in the node, and has no 42 - effect on any properties that are omitted. 43 - 44 - The pin group node accepts a subset of the generic pin config properties. For 45 - details generic pin config properties, please refer to pinctrl-bindings.txt 46 - and <include/linux/pinctrl/pinconfig-generic.h>. 47 - 48 - Each pin controlled by this pin controller belong to one of three types: 49 - Standard, I2C, and HDMI. Each type accepts a different set of pin config 50 - properties. A list of pins and their types is provided below. 51 - 52 - Required Properties (applicable to all pins): 53 - 54 - - pins: Multiple strings. Specifies the name(s) of one or more pins to 55 - be configured by this node. 56 - 57 - Optional Properties (for standard pins): 58 - 59 - - function: String. Specifies the pin mux selection. Values 60 - must be one of: "alt1", "alt2", "alt3", "alt4" 61 - - input-schmitt-enable: No arguments. Enable schmitt-trigger mode. 62 - - input-schmitt-disable: No arguments. Disable schmitt-trigger mode. 63 - - bias-pull-up: No arguments. Pull up on pin. 64 - - bias-pull-down: No arguments. Pull down on pin. 65 - - bias-disable: No arguments. Disable pin bias. 66 - - slew-rate: Integer. Meaning depends on configured pin mux: 67 - *_SCL or *_SDA: 68 - 0: Standard(100kbps)& Fast(400kbps) mode 69 - 1: Highspeed (3.4Mbps) mode 70 - IC_DM or IC_DP: 71 - 0: normal slew rate 72 - 1: fast slew rate 73 - Otherwise: 74 - 0: fast slew rate 75 - 1: normal slew rate 76 - - input-enable: No arguments. Enable input (does not affect 77 - output.) 78 - - input-disable: No arguments. Disable input (does not affect 79 - output.) 80 - - drive-strength: Integer. Drive strength in mA. Valid values are 81 - 2, 4, 6, 8, 10, 12, 14, 16 mA. 82 - 83 - Optional Properties (for I2C pins): 84 - 85 - - function: String. Specifies the pin mux selection. Values 86 - must be one of: "alt1", "alt2", "alt3", "alt4" 87 - - bias-pull-up: Integer. Pull up strength in Ohm. There are 3 88 - pull-up resistors (1.2k, 1.8k, 2.7k) available 89 - in parallel for I2C pins, so the valid values 90 - are: 568, 720, 831, 1080, 1200, 1800, 2700 Ohm. 91 - - bias-disable: No arguments. Disable pin bias. 92 - - slew-rate: Integer. Meaning depends on configured pin mux: 93 - *_SCL or *_SDA: 94 - 0: Standard(100kbps)& Fast(400kbps) mode 95 - 1: Highspeed (3.4Mbps) mode 96 - IC_DM or IC_DP: 97 - 0: normal slew rate 98 - 1: fast slew rate 99 - Otherwise: 100 - 0: fast slew rate 101 - 1: normal slew rate 102 - - input-enable: No arguments. Enable input (does not affect 103 - output.) 104 - - input-disable: No arguments. Disable input (does not affect 105 - output.) 106 - 107 - Optional Properties (for HDMI pins): 108 - 109 - - function: String. Specifies the pin mux selection. Values 110 - must be one of: "alt1", "alt2", "alt3", "alt4" 111 - - slew-rate: Integer. Controls slew rate. 112 - 0: Standard(100kbps)& Fast(400kbps) mode 113 - 1: Highspeed (3.4Mbps) mode 114 - - input-enable: No arguments. Enable input (does not affect 115 - output.) 116 - - input-disable: No arguments. Disable input (does not affect 117 - output.) 118 - 119 - Example: 120 - // pin controller node 121 - pinctrl@35004800 { 122 - compatible = "brcm,bcm11351-pinctrl"; 123 - reg = <0x35004800 0x430>; 124 - 125 - // pin configuration node 126 - dev_a_default: dev_a_active { 127 - //group node defining 1 standard pin 128 - grp_1 { 129 - pins = "std_pin1"; 130 - function = "alt1"; 131 - input-schmitt-enable; 132 - bias-disable; 133 - slew-rate = <1>; 134 - drive-strength = <4>; 135 - }; 136 - 137 - // group node defining 2 I2C pins 138 - grp_2 { 139 - pins = "i2c_pin1", "i2c_pin2"; 140 - function = "alt2"; 141 - bias-pull-up = <720>; 142 - input-enable; 143 - }; 144 - 145 - // group node defining 2 HDMI pins 146 - grp_3 { 147 - pins = "hdmi_pin1", "hdmi_pin2"; 148 - function = "alt3"; 149 - slew-rate = <1>; 150 - }; 151 - 152 - // other pin group nodes 153 - ... 154 - }; 155 - 156 - // other pin configuration nodes 157 - ... 158 - }; 159 - 160 - In the example above, "dev_a_active" is a pin configuration node with a number 161 - of sub-nodes. In the pin group node "grp_1", one pin, "std_pin1", is defined in 162 - the "pins" property. Thus, the remaining properties in the "grp_1" node applies 163 - only to this pin, including the following settings: 164 - - setting pinmux to "alt1" 165 - - enabling schmitt-trigger (hystersis) mode 166 - - disabling pin bias 167 - - setting the slew-rate to 1 168 - - setting the drive strength to 4 mA 169 - Note that neither "input-enable" nor "input-disable" was specified - the pinctrl 170 - subsystem will therefore leave this property unchanged from whatever state it 171 - was in before applying these changes. 172 - 173 - The "pins" property in the pin group node "grp_2" specifies two pins - 174 - "i2c_pin1" and "i2c_pin2"; the remaining properties in this pin group node, 175 - therefore, applies to both of these pins. The properties include: 176 - - setting pinmux to "alt2" 177 - - setting pull-up resistance to 720 Ohm (ie. enabling 1.2k and 1.8k resistors 178 - in parallel) 179 - - enabling both pins' input 180 - "slew-rate" is not specified in this pin group node, so the slew-rate for these 181 - pins are left as-is. 182 - 183 - Finally, "grp_3" defines two HDMI pins. The following properties are applied to 184 - both pins: 185 - - setting pinmux to "alt3" 186 - - setting slew-rate to 1; for HDMI pins, this corresponds to the 3.4 Mbps 187 - Highspeed mode 188 - The input is neither enabled or disabled, and is left untouched. 189 - 190 - === Pin Names and Type === 191 - 192 - The following are valid pin names and their pin types: 193 - 194 - "adcsync", Standard 195 - "bat_rm", Standard 196 - "bsc1_scl", I2C 197 - "bsc1_sda", I2C 198 - "bsc2_scl", I2C 199 - "bsc2_sda", I2C 200 - "classgpwr", Standard 201 - "clk_cx8", Standard 202 - "clkout_0", Standard 203 - "clkout_1", Standard 204 - "clkout_2", Standard 205 - "clkout_3", Standard 206 - "clkreq_in_0", Standard 207 - "clkreq_in_1", Standard 208 - "cws_sys_req1", Standard 209 - "cws_sys_req2", Standard 210 - "cws_sys_req3", Standard 211 - "digmic1_clk", Standard 212 - "digmic1_dq", Standard 213 - "digmic2_clk", Standard 214 - "digmic2_dq", Standard 215 - "gpen13", Standard 216 - "gpen14", Standard 217 - "gpen15", Standard 218 - "gpio00", Standard 219 - "gpio01", Standard 220 - "gpio02", Standard 221 - "gpio03", Standard 222 - "gpio04", Standard 223 - "gpio05", Standard 224 - "gpio06", Standard 225 - "gpio07", Standard 226 - "gpio08", Standard 227 - "gpio09", Standard 228 - "gpio10", Standard 229 - "gpio11", Standard 230 - "gpio12", Standard 231 - "gpio13", Standard 232 - "gpio14", Standard 233 - "gps_pablank", Standard 234 - "gps_tmark", Standard 235 - "hdmi_scl", HDMI 236 - "hdmi_sda", HDMI 237 - "ic_dm", Standard 238 - "ic_dp", Standard 239 - "kp_col_ip_0", Standard 240 - "kp_col_ip_1", Standard 241 - "kp_col_ip_2", Standard 242 - "kp_col_ip_3", Standard 243 - "kp_row_op_0", Standard 244 - "kp_row_op_1", Standard 245 - "kp_row_op_2", Standard 246 - "kp_row_op_3", Standard 247 - "lcd_b_0", Standard 248 - "lcd_b_1", Standard 249 - "lcd_b_2", Standard 250 - "lcd_b_3", Standard 251 - "lcd_b_4", Standard 252 - "lcd_b_5", Standard 253 - "lcd_b_6", Standard 254 - "lcd_b_7", Standard 255 - "lcd_g_0", Standard 256 - "lcd_g_1", Standard 257 - "lcd_g_2", Standard 258 - "lcd_g_3", Standard 259 - "lcd_g_4", Standard 260 - "lcd_g_5", Standard 261 - "lcd_g_6", Standard 262 - "lcd_g_7", Standard 263 - "lcd_hsync", Standard 264 - "lcd_oe", Standard 265 - "lcd_pclk", Standard 266 - "lcd_r_0", Standard 267 - "lcd_r_1", Standard 268 - "lcd_r_2", Standard 269 - "lcd_r_3", Standard 270 - "lcd_r_4", Standard 271 - "lcd_r_5", Standard 272 - "lcd_r_6", Standard 273 - "lcd_r_7", Standard 274 - "lcd_vsync", Standard 275 - "mdmgpio0", Standard 276 - "mdmgpio1", Standard 277 - "mdmgpio2", Standard 278 - "mdmgpio3", Standard 279 - "mdmgpio4", Standard 280 - "mdmgpio5", Standard 281 - "mdmgpio6", Standard 282 - "mdmgpio7", Standard 283 - "mdmgpio8", Standard 284 - "mphi_data_0", Standard 285 - "mphi_data_1", Standard 286 - "mphi_data_2", Standard 287 - "mphi_data_3", Standard 288 - "mphi_data_4", Standard 289 - "mphi_data_5", Standard 290 - "mphi_data_6", Standard 291 - "mphi_data_7", Standard 292 - "mphi_data_8", Standard 293 - "mphi_data_9", Standard 294 - "mphi_data_10", Standard 295 - "mphi_data_11", Standard 296 - "mphi_data_12", Standard 297 - "mphi_data_13", Standard 298 - "mphi_data_14", Standard 299 - "mphi_data_15", Standard 300 - "mphi_ha0", Standard 301 - "mphi_hat0", Standard 302 - "mphi_hat1", Standard 303 - "mphi_hce0_n", Standard 304 - "mphi_hce1_n", Standard 305 - "mphi_hrd_n", Standard 306 - "mphi_hwr_n", Standard 307 - "mphi_run0", Standard 308 - "mphi_run1", Standard 309 - "mtx_scan_clk", Standard 310 - "mtx_scan_data", Standard 311 - "nand_ad_0", Standard 312 - "nand_ad_1", Standard 313 - "nand_ad_2", Standard 314 - "nand_ad_3", Standard 315 - "nand_ad_4", Standard 316 - "nand_ad_5", Standard 317 - "nand_ad_6", Standard 318 - "nand_ad_7", Standard 319 - "nand_ale", Standard 320 - "nand_cen_0", Standard 321 - "nand_cen_1", Standard 322 - "nand_cle", Standard 323 - "nand_oen", Standard 324 - "nand_rdy_0", Standard 325 - "nand_rdy_1", Standard 326 - "nand_wen", Standard 327 - "nand_wp", Standard 328 - "pc1", Standard 329 - "pc2", Standard 330 - "pmu_int", Standard 331 - "pmu_scl", I2C 332 - "pmu_sda", I2C 333 - "rfst2g_mtsloten3g", Standard 334 - "rgmii_0_rx_ctl", Standard 335 - "rgmii_0_rxc", Standard 336 - "rgmii_0_rxd_0", Standard 337 - "rgmii_0_rxd_1", Standard 338 - "rgmii_0_rxd_2", Standard 339 - "rgmii_0_rxd_3", Standard 340 - "rgmii_0_tx_ctl", Standard 341 - "rgmii_0_txc", Standard 342 - "rgmii_0_txd_0", Standard 343 - "rgmii_0_txd_1", Standard 344 - "rgmii_0_txd_2", Standard 345 - "rgmii_0_txd_3", Standard 346 - "rgmii_1_rx_ctl", Standard 347 - "rgmii_1_rxc", Standard 348 - "rgmii_1_rxd_0", Standard 349 - "rgmii_1_rxd_1", Standard 350 - "rgmii_1_rxd_2", Standard 351 - "rgmii_1_rxd_3", Standard 352 - "rgmii_1_tx_ctl", Standard 353 - "rgmii_1_txc", Standard 354 - "rgmii_1_txd_0", Standard 355 - "rgmii_1_txd_1", Standard 356 - "rgmii_1_txd_2", Standard 357 - "rgmii_1_txd_3", Standard 358 - "rgmii_gpio_0", Standard 359 - "rgmii_gpio_1", Standard 360 - "rgmii_gpio_2", Standard 361 - "rgmii_gpio_3", Standard 362 - "rtxdata2g_txdata3g1", Standard 363 - "rtxen2g_txdata3g2", Standard 364 - "rxdata3g0", Standard 365 - "rxdata3g1", Standard 366 - "rxdata3g2", Standard 367 - "sdio1_clk", Standard 368 - "sdio1_cmd", Standard 369 - "sdio1_data_0", Standard 370 - "sdio1_data_1", Standard 371 - "sdio1_data_2", Standard 372 - "sdio1_data_3", Standard 373 - "sdio4_clk", Standard 374 - "sdio4_cmd", Standard 375 - "sdio4_data_0", Standard 376 - "sdio4_data_1", Standard 377 - "sdio4_data_2", Standard 378 - "sdio4_data_3", Standard 379 - "sim_clk", Standard 380 - "sim_data", Standard 381 - "sim_det", Standard 382 - "sim_resetn", Standard 383 - "sim2_clk", Standard 384 - "sim2_data", Standard 385 - "sim2_det", Standard 386 - "sim2_resetn", Standard 387 - "sri_c", Standard 388 - "sri_d", Standard 389 - "sri_e", Standard 390 - "ssp_extclk", Standard 391 - "ssp0_clk", Standard 392 - "ssp0_fs", Standard 393 - "ssp0_rxd", Standard 394 - "ssp0_txd", Standard 395 - "ssp2_clk", Standard 396 - "ssp2_fs_0", Standard 397 - "ssp2_fs_1", Standard 398 - "ssp2_fs_2", Standard 399 - "ssp2_fs_3", Standard 400 - "ssp2_rxd_0", Standard 401 - "ssp2_rxd_1", Standard 402 - "ssp2_txd_0", Standard 403 - "ssp2_txd_1", Standard 404 - "ssp3_clk", Standard 405 - "ssp3_fs", Standard 406 - "ssp3_rxd", Standard 407 - "ssp3_txd", Standard 408 - "ssp4_clk", Standard 409 - "ssp4_fs", Standard 410 - "ssp4_rxd", Standard 411 - "ssp4_txd", Standard 412 - "ssp5_clk", Standard 413 - "ssp5_fs", Standard 414 - "ssp5_rxd", Standard 415 - "ssp5_txd", Standard 416 - "ssp6_clk", Standard 417 - "ssp6_fs", Standard 418 - "ssp6_rxd", Standard 419 - "ssp6_txd", Standard 420 - "stat_1", Standard 421 - "stat_2", Standard 422 - "sysclken", Standard 423 - "traceclk", Standard 424 - "tracedt00", Standard 425 - "tracedt01", Standard 426 - "tracedt02", Standard 427 - "tracedt03", Standard 428 - "tracedt04", Standard 429 - "tracedt05", Standard 430 - "tracedt06", Standard 431 - "tracedt07", Standard 432 - "tracedt08", Standard 433 - "tracedt09", Standard 434 - "tracedt10", Standard 435 - "tracedt11", Standard 436 - "tracedt12", Standard 437 - "tracedt13", Standard 438 - "tracedt14", Standard 439 - "tracedt15", Standard 440 - "txdata3g0", Standard 441 - "txpwrind", Standard 442 - "uartb1_ucts", Standard 443 - "uartb1_urts", Standard 444 - "uartb1_urxd", Standard 445 - "uartb1_utxd", Standard 446 - "uartb2_urxd", Standard 447 - "uartb2_utxd", Standard 448 - "uartb3_ucts", Standard 449 - "uartb3_urts", Standard 450 - "uartb3_urxd", Standard 451 - "uartb3_utxd", Standard 452 - "uartb4_ucts", Standard 453 - "uartb4_urts", Standard 454 - "uartb4_urxd", Standard 455 - "uartb4_utxd", Standard 456 - "vc_cam1_scl", I2C 457 - "vc_cam1_sda", I2C 458 - "vc_cam2_scl", I2C 459 - "vc_cam2_sda", I2C 460 - "vc_cam3_scl", I2C 461 - "vc_cam3_sda", I2C
+259
Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/brcm,bcm11351-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM281xx pin controller 8 + 9 + maintainers: 10 + - Florian Fainelli <florian.fainelli@broadcom.com> 11 + - Ray Jui <rjui@broadcom.com> 12 + - Scott Branden <sbranden@broadcom.com> 13 + 14 + allOf: 15 + - $ref: pinctrl.yaml# 16 + 17 + properties: 18 + compatible: 19 + const: brcm,bcm11351-pinctrl 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + patternProperties: 25 + '-pins$': 26 + type: object 27 + additionalProperties: false 28 + 29 + patternProperties: 30 + '-grp[0-9]$': 31 + type: object 32 + unevaluatedProperties: false 33 + 34 + properties: 35 + pins: 36 + description: 37 + Specifies the name(s) of one or more pins to be configured by 38 + this node. 39 + items: 40 + enum: [ adcsync, bat_rm, bsc1_scl, bsc1_sda, bsc2_scl, bsc2_sda, 41 + classgpwr, clk_cx8, clkout_0, clkout_1, clkout_2, 42 + clkout_3, clkreq_in_0, clkreq_in_1, cws_sys_req1, 43 + cws_sys_req2, cws_sys_req3, digmic1_clk, digmic1_dq, 44 + digmic2_clk, digmic2_dq, gpen13, gpen14, gpen15, gpio00, 45 + gpio01, gpio02, gpio03, gpio04, gpio05, gpio06, gpio07, 46 + gpio08, gpio09, gpio10, gpio11, gpio12, gpio13, gpio14, 47 + gps_pablank, gps_tmark, hdmi_scl, hdmi_sda, ic_dm, ic_dp, 48 + kp_col_ip_0, kp_col_ip_1, kp_col_ip_2, kp_col_ip_3, 49 + kp_row_op_0, kp_row_op_1, kp_row_op_2, kp_row_op_3, 50 + lcd_b_0, lcd_b_1, lcd_b_2, lcd_b_3, lcd_b_4, lcd_b_5, 51 + lcd_b_6, lcd_b_7, lcd_g_0, lcd_g_1, lcd_g_2, lcd_g_3, 52 + lcd_g_4, lcd_g_5, lcd_g_6, lcd_g_7, lcd_hsync, lcd_oe, 53 + lcd_pclk, lcd_r_0, lcd_r_1, lcd_r_2, lcd_r_3, lcd_r_4, 54 + lcd_r_5, lcd_r_6, lcd_r_7, lcd_vsync, mdmgpio0, mdmgpio1, 55 + mdmgpio2, mdmgpio3, mdmgpio4, mdmgpio5, mdmgpio6, 56 + mdmgpio7, mdmgpio8, mphi_data_0, mphi_data_1, mphi_data_2, 57 + mphi_data_3, mphi_data_4, mphi_data_5, mphi_data_6, 58 + mphi_data_7, mphi_data_8, mphi_data_9, mphi_data_10, 59 + mphi_data_11, mphi_data_12, mphi_data_13, mphi_data_14, 60 + mphi_data_15, mphi_ha0, mphi_hat0, mphi_hat1, mphi_hce0_n, 61 + mphi_hce1_n, mphi_hrd_n, mphi_hwr_n, mphi_run0, mphi_run1, 62 + mtx_scan_clk, mtx_scan_data, nand_ad_0, nand_ad_1, 63 + nand_ad_2, nand_ad_3, nand_ad_4, nand_ad_5, nand_ad_6, 64 + nand_ad_7, nand_ale, nand_cen_0, nand_cen_1, nand_cle, 65 + nand_oen, nand_rdy_0, nand_rdy_1, nand_wen, nand_wp, pc1, 66 + pc2, pmu_int, pmu_scl, pmu_sda, rfst2g_mtsloten3g, 67 + rgmii_0_rx_ctl, rgmii_0_rxc, rgmii_0_rxd_0, rgmii_0_rxd_1, 68 + rgmii_0_rxd_2, rgmii_0_rxd_3, rgmii_0_tx_ctl, rgmii_0_txc, 69 + rgmii_0_txd_0, rgmii_0_txd_1, rgmii_0_txd_2, 70 + rgmii_0_txd_3, rgmii_1_rx_ctl, rgmii_1_rxc, rgmii_1_rxd_0, 71 + rgmii_1_rxd_1, rgmii_1_rxd_2, rgmii_1_rxd_3, 72 + rgmii_1_tx_ctl, rgmii_1_txc, rgmii_1_txd_0, rgmii_1_txd_1, 73 + rgmii_1_txd_2, rgmii_1_txd_3, rgmii_gpio_0, rgmii_gpio_1, 74 + rgmii_gpio_2, rgmii_gpio_3, rtxdata2g_txdata3g1, 75 + rtxen2g_txdata3g2, rxdata3g0, rxdata3g1, rxdata3g2, 76 + sdio1_clk, sdio1_cmd, sdio1_data_0, sdio1_data_1, 77 + sdio1_data_2, sdio1_data_3, sdio4_clk, sdio4_cmd, 78 + sdio4_data_0, sdio4_data_1, sdio4_data_2, sdio4_data_3, 79 + sim_clk, sim_data, sim_det, sim_resetn, sim2_clk, 80 + sim2_data, sim2_det, sim2_resetn, sri_c, sri_d, sri_e, 81 + ssp_extclk, ssp0_clk, ssp0_fs, ssp0_rxd, ssp0_txd, 82 + ssp2_clk, ssp2_fs_0, ssp2_fs_1, ssp2_fs_2, ssp2_fs_3, 83 + ssp2_rxd_0, ssp2_rxd_1, ssp2_txd_0, ssp2_txd_1, ssp3_clk, 84 + ssp3_fs, ssp3_rxd, ssp3_txd, ssp4_clk, ssp4_fs, ssp4_rxd, 85 + ssp4_txd, ssp5_clk, ssp5_fs, ssp5_rxd, ssp5_txd, ssp6_clk, 86 + ssp6_fs, ssp6_rxd, ssp6_txd, stat_1, stat_2, sysclken, 87 + traceclk, tracedt00, tracedt01, tracedt02, tracedt03, 88 + tracedt04, tracedt05, tracedt06, tracedt07, tracedt08 89 + tracedt09, tracedt10, tracedt11, tracedt12, tracedt13 90 + tracedt14, tracedt15, txdata3g0, txpwrind, uartb1_ucts, 91 + uartb1_urts, uartb1_urxd, uartb1_utxd, uartb2_urxd, 92 + uartb2_utxd, uartb3_ucts, uartb3_urts, uartb3_urxd, 93 + uartb3_utxd, uartb4_ucts, uartb4_urts, uartb4_urxd, 94 + uartb4_utxd, vc_cam1_scl, vc_cam1_sda, vc_cam2_scl, 95 + vc_cam2_sda, vc_cam3_scl, vc_cam3_sda ] 96 + 97 + function: 98 + description: 99 + Specifies the pin mux selection. 100 + enum: [ alt1, alt2, alt3, alt4 ] 101 + 102 + slew-rate: 103 + description: | 104 + Meaning depends on configured pin mux: 105 + *_scl or *_sda: 106 + 0: Standard (100 kbps) & Fast (400 kbps) mode 107 + 1: Highspeed (3.4 Mbps) mode 108 + ic_dm or ic_dp: 109 + 0: normal slew rate 110 + 1: fast slew rate 111 + Otherwise: 112 + 0: fast slew rate 113 + 1: normal slew rate 114 + 115 + bias-disable: true 116 + input-disable: true 117 + input-enable: true 118 + 119 + required: 120 + - pins 121 + 122 + allOf: 123 + - $ref: pincfg-node.yaml# 124 + 125 + # Optional properties for standard pins 126 + - if: 127 + properties: 128 + pins: 129 + contains: 130 + enum: [ adcsync, bat_rm, classgpwr, clk_cx8, clkout_0, 131 + clkout_1, clkout_2, clkout_3, clkreq_in_0, 132 + clkreq_in_1, cws_sys_req1, cws_sys_req2, 133 + cws_sys_req3, digmic1_clk, digmic1_dq, digmic2_clk, 134 + digmic2_dq, gpen13, gpen14, gpen15, gpio00, gpio01, 135 + gpio02, gpio03, gpio04, gpio05, gpio06, gpio07, 136 + gpio08, gpio09, gpio10, gpio11, gpio12, gpio13, 137 + gpio14, gps_pablank, gps_tmark, ic_dm, ic_dp, 138 + kp_col_ip_0, kp_col_ip_1, kp_col_ip_2, kp_col_ip_3, 139 + kp_row_op_0, kp_row_op_1, kp_row_op_2, kp_row_op_3, 140 + lcd_b_0, lcd_b_1, lcd_b_2, lcd_b_3, lcd_b_4, lcd_b_5, 141 + lcd_b_6, lcd_b_7, lcd_g_0, lcd_g_1, lcd_g_2, lcd_g_3, 142 + lcd_g_4, lcd_g_5, lcd_g_6, lcd_g_7, lcd_hsync, 143 + lcd_oe, lcd_pclk, lcd_r_0, lcd_r_1, lcd_r_2, 144 + lcd_r_3, lcd_r_4, lcd_r_5, lcd_r_6, lcd_r_7, 145 + lcd_vsync, mdmgpio0, mdmgpio1, mdmgpio2, mdmgpio3, 146 + mdmgpio4, mdmgpio5, mdmgpio6, mdmgpio7, mdmgpio8, 147 + mphi_data_0, mphi_data_1, mphi_data_2, mphi_data_3, 148 + mphi_data_4, mphi_data_5, mphi_data_6, mphi_data_7, 149 + mphi_data_8, mphi_data_9, mphi_data_10, 150 + mphi_data_11, mphi_data_12, mphi_data_13, 151 + mphi_data_14, mphi_data_15, mphi_ha0, mphi_hat0, 152 + mphi_hat1, mphi_hce0_n, mphi_hce1_n, mphi_hrd_n, 153 + mphi_hwr_n, mphi_run0, mphi_run1, mtx_scan_clk, 154 + mtx_scan_data, nand_ad_0, nand_ad_1, nand_ad_2, 155 + nand_ad_3, nand_ad_4, nand_ad_5, nand_ad_6, 156 + nand_ad_7, nand_ale, nand_cen_0, nand_cen_1, 157 + nand_cle, nand_oen, nand_rdy_0, nand_rdy_1, 158 + nand_wen, nand_wp, pc1, pc2, pmu_int, 159 + rfst2g_mtsloten3g, rgmii_0_rx_ctl, rgmii_0_rxc, 160 + rgmii_0_rxd_0, rgmii_0_rxd_1, rgmii_0_rxd_2, 161 + rgmii_0_rxd_3, rgmii_0_tx_ctl, rgmii_0_txc, 162 + rgmii_0_txd_0, rgmii_0_txd_1, rgmii_0_txd_2, 163 + rgmii_0_txd_3, rgmii_1_rx_ctl, rgmii_1_rxc, 164 + rgmii_1_rxd_0, rgmii_1_rxd_1, rgmii_1_rxd_2, 165 + rgmii_1_rxd_3, rgmii_1_tx_ctl, rgmii_1_txc, 166 + rgmii_1_txd_0, rgmii_1_txd_1, rgmii_1_txd_2, 167 + rgmii_1_txd_3, rgmii_gpio_0, rgmii_gpio_1, 168 + rgmii_gpio_2, rgmii_gpio_3, rtxdata2g_txdata3g1, 169 + rtxen2g_txdata3g2, rxdata3g0, rxdata3g1, rxdata3g2, 170 + sdio1_clk, sdio1_cmd, sdio1_data_0, sdio1_data_1, 171 + sdio1_data_2, sdio1_data_3, sdio4_clk, sdio4_cmd, 172 + sdio4_data_0, sdio4_data_1, sdio4_data_2, 173 + sdio4_data_3, sim_clk, sim_data, sim_det, 174 + sim_resetn, sim2_clk, sim2_data, sim2_det, 175 + sim2_resetn, sri_c, sri_d, sri_e, ssp_extclk, 176 + ssp0_clk, ssp0_fs, ssp0_rxd, ssp0_txd, ssp2_clk, 177 + ssp2_fs_0, ssp2_fs_1, ssp2_fs_2, ssp2_fs_3, 178 + ssp2_rxd_0, ssp2_rxd_1, ssp2_txd_0, ssp2_txd_1, 179 + ssp3_clk, ssp3_fs, ssp3_rxd, ssp3_txd, ssp4_clk, 180 + ssp4_fs, ssp4_rxd, ssp4_txd, ssp5_clk, ssp5_fs, 181 + ssp5_rxd, ssp5_txd, ssp6_clk, ssp6_fs, ssp6_rxd, 182 + ssp6_txd, stat_1, stat_2, sysclken, traceclk, 183 + tracedt00, tracedt01, tracedt02, tracedt03, 184 + tracedt04, tracedt05, tracedt06, tracedt07, 185 + tracedt08, tracedt09, tracedt10, tracedt11, 186 + tracedt12, tracedt13, tracedt14, tracedt15, 187 + txdata3g0, txpwrind, uartb1_ucts, uartb1_urts, 188 + uartb1_urxd, uartb1_utxd, uartb2_urxd, uartb2_utxd, 189 + uartb3_ucts, uartb3_urts, uartb3_urxd, uartb3_utxd, 190 + uartb4_ucts, uartb4_urts, uartb4_urxd, uartb4_utxd ] 191 + then: 192 + properties: 193 + drive-strength: 194 + enum: [ 2, 4, 6, 8, 10, 12, 14, 16 ] 195 + 196 + bias-disable: true 197 + bias-pull-up: true 198 + bias-pull-down: true 199 + input-schmitt-enable: true 200 + input-schmitt-disable: true 201 + 202 + # Optional properties for I2C pins 203 + - if: 204 + properties: 205 + pins: 206 + contains: 207 + enum: [ bsc1_scl, bsc1_sda, bsc2_scl, bsc2_sda, pmu_scl, 208 + pmu_sda, vc_cam1_scl, vc_cam1_sda, vc_cam2_scl, 209 + vc_cam2_sda, vc_cam3_scl, vc_cam3_sda ] 210 + then: 211 + properties: 212 + bias-pull-up: 213 + description: 214 + There are 3 pull-up resistors (1.2k, 1.8k, 2.7k) available 215 + in parallel for I2C pins. 216 + enum: [ 568, 720, 831, 1080, 1200, 1800, 2700 ] 217 + 218 + bias-disable: true 219 + 220 + required: 221 + - compatible 222 + - reg 223 + 224 + unevaluatedProperties: false 225 + 226 + examples: 227 + - | 228 + pinctrl@35004800 { 229 + compatible = "brcm,bcm11351-pinctrl"; 230 + reg = <0x35004800 0x430>; 231 + 232 + dev-a-active-pins { 233 + /* group node defining 1 standard pin */ 234 + std-grp0 { 235 + pins = "gpio00"; 236 + function = "alt1"; 237 + input-schmitt-enable; 238 + bias-disable; 239 + slew-rate = <1>; 240 + drive-strength = <4>; 241 + }; 242 + 243 + /* group node defining 2 I2C pins */ 244 + i2c-grp0 { 245 + pins = "bsc1_scl", "bsc1_sda"; 246 + function = "alt2"; 247 + bias-pull-up = <720>; 248 + input-enable; 249 + }; 250 + 251 + /* group node defining 2 HDMI pins */ 252 + hdmi-grp0 { 253 + pins = "hdmi_scl", "hdmi_sda"; 254 + function = "alt3"; 255 + slew-rate = <1>; 256 + }; 257 + }; 258 + }; 259 + ...
+4
Documentation/devicetree/bindings/pinctrl/cypress,cy8c95x0.yaml
··· 51 51 description: 52 52 Optional power supply. 53 53 54 + reset-gpios: 55 + description: GPIO connected to the XRES pin 56 + maxItems: 1 57 + 54 58 patternProperties: 55 59 '-pins$': 56 60 type: object
-4
Documentation/devicetree/bindings/pinctrl/ingenic,pinctrl.yaml
··· 135 135 - $ref: pinmux-node.yaml# 136 136 137 137 properties: 138 - phandle: true 139 138 function: true 140 139 groups: true 141 140 pins: true ··· 146 147 additionalProperties: false 147 148 148 149 - type: object 149 - properties: 150 - phandle: true 151 150 additionalProperties: 152 151 type: object 153 152 allOf: ··· 153 156 - $ref: pinmux-node.yaml# 154 157 155 158 properties: 156 - phandle: true 157 159 function: true 158 160 groups: true 159 161 pins: true
-2
Documentation/devicetree/bindings/pinctrl/nvidia,tegra114-pinmux.yaml
··· 22 22 patternProperties: 23 23 "^pinmux(-[a-z0-9-_]+)?$": 24 24 type: object 25 - properties: 26 - phandle: true 27 25 28 26 # pin groups 29 27 additionalProperties:
-2
Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.yaml
··· 32 32 patternProperties: 33 33 "^pinmux(-[a-z0-9-_]+)?$": 34 34 type: object 35 - properties: 36 - phandle: true 37 35 38 36 # pin groups 39 37 additionalProperties:
-2
Documentation/devicetree/bindings/pinctrl/nvidia,tegra194-pinmux.yaml
··· 23 23 patternProperties: 24 24 "^pinmux(-[a-z0-9-_]+)?$": 25 25 type: object 26 - properties: 27 - phandle: true 28 26 29 27 # pin groups 30 28 additionalProperties:
-2
Documentation/devicetree/bindings/pinctrl/nvidia,tegra20-pinmux.yaml
··· 24 24 patternProperties: 25 25 "^pinmux(-[a-z0-9-_]+)?$": 26 26 type: object 27 - properties: 28 - phandle: true 29 27 30 28 # pin groups 31 29 additionalProperties:
-2
Documentation/devicetree/bindings/pinctrl/nvidia,tegra210-pinmux.yaml
··· 22 22 patternProperties: 23 23 "^pinmux(-[a-z0-9-_]+)?$": 24 24 type: object 25 - properties: 26 - phandle: true 27 25 28 26 # pin groups 29 27 additionalProperties:
-2
Documentation/devicetree/bindings/pinctrl/nvidia,tegra30-pinmux.yaml
··· 22 22 patternProperties: 23 23 "^pinmux(-[a-z0-9-_]+)?$": 24 24 type: object 25 - properties: 26 - phandle: true 27 25 28 26 # pin groups 29 27 additionalProperties:
-56
Documentation/devicetree/bindings/pinctrl/oxnas,pinctrl.txt
··· 1 - * Oxford Semiconductor OXNAS SoC Family Pin Controller 2 - 3 - Please refer to pinctrl-bindings.txt, ../gpio/gpio.txt, and 4 - ../interrupt-controller/interrupts.txt for generic information regarding 5 - pin controller, GPIO, and interrupt bindings. 6 - 7 - OXNAS 'pin configuration node' is a node of a group of pins which can be 8 - used for a specific device or function. This node represents configurations of 9 - pins, optional function, and optional mux related configuration. 10 - 11 - Required properties for pin controller node: 12 - - compatible: "oxsemi,ox810se-pinctrl" or "oxsemi,ox820-pinctrl" 13 - - oxsemi,sys-ctrl: a phandle to the system controller syscon node 14 - 15 - Required properties for pin configuration sub-nodes: 16 - - pins: List of pins to which the configuration applies. 17 - 18 - Optional properties for pin configuration sub-nodes: 19 - ---------------------------------------------------- 20 - - function: Mux function for the specified pins. 21 - - bias-pull-up: Enable weak pull-up. 22 - 23 - Example: 24 - 25 - pinctrl: pinctrl { 26 - compatible = "oxsemi,ox810se-pinctrl"; 27 - 28 - /* Regmap for sys registers */ 29 - oxsemi,sys-ctrl = <&sys>; 30 - 31 - pinctrl_uart2: pinctrl_uart2 { 32 - uart2a { 33 - pins = "gpio31"; 34 - function = "fct3"; 35 - }; 36 - uart2b { 37 - pins = "gpio32"; 38 - function = "fct3"; 39 - }; 40 - }; 41 - }; 42 - 43 - uart2: serial@900000 { 44 - compatible = "ns16550a"; 45 - reg = <0x900000 0x100000>; 46 - clocks = <&sysclk>; 47 - interrupts = <29>; 48 - reg-shift = <0>; 49 - fifo-size = <16>; 50 - reg-io-width = <1>; 51 - current-speed = <115200>; 52 - no-loopback-test; 53 - resets = <&reset 22>; 54 - pinctrl-names = "default"; 55 - pinctrl-0 = <&pinctrl_uart2>; 56 - };
-262
Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt
··· 1 - One-register-per-pin type device tree based pinctrl driver 2 - 3 - Required properties: 4 - - compatible : "pinctrl-single" or "pinconf-single". 5 - "pinctrl-single" means that pinconf isn't supported. 6 - "pinconf-single" means that generic pinconf is supported. 7 - 8 - - reg : offset and length of the register set for the mux registers 9 - 10 - - #pinctrl-cells : number of cells in addition to the index, set to 1 11 - or 2 for pinctrl-single,pins and set to 2 for pinctrl-single,bits 12 - 13 - - pinctrl-single,register-width : pinmux register access width in bits 14 - 15 - - pinctrl-single,function-mask : mask of allowed pinmux function bits 16 - in the pinmux register 17 - 18 - Optional properties: 19 - - pinctrl-single,function-off : function off mode for disabled state if 20 - available and same for all registers; if not specified, disabling of 21 - pin functions is ignored 22 - 23 - - pinctrl-single,bit-per-mux : boolean to indicate that one register controls 24 - more than one pin, for which "pinctrl-single,function-mask" property specifies 25 - position mask of pin. 26 - 27 - - pinctrl-single,drive-strength : array of value that are used to configure 28 - drive strength in the pinmux register. They're value of drive strength 29 - current and drive strength mask. 30 - 31 - /* drive strength current, mask */ 32 - pinctrl-single,power-source = <0x30 0xf0>; 33 - 34 - - pinctrl-single,bias-pullup : array of value that are used to configure the 35 - input bias pullup in the pinmux register. 36 - 37 - /* input, enabled pullup bits, disabled pullup bits, mask */ 38 - pinctrl-single,bias-pullup = <0 1 0 1>; 39 - 40 - - pinctrl-single,bias-pulldown : array of value that are used to configure the 41 - input bias pulldown in the pinmux register. 42 - 43 - /* input, enabled pulldown bits, disabled pulldown bits, mask */ 44 - pinctrl-single,bias-pulldown = <2 2 0 2>; 45 - 46 - * Two bits to control input bias pullup and pulldown: User should use 47 - pinctrl-single,bias-pullup & pinctrl-single,bias-pulldown. One bit means 48 - pullup, and the other one bit means pulldown. 49 - * Three bits to control input bias enable, pullup and pulldown. User should 50 - use pinctrl-single,bias-pullup & pinctrl-single,bias-pulldown. Input bias 51 - enable bit should be included in pullup or pulldown bits. 52 - * Although driver could set PIN_CONFIG_BIAS_DISABLE, there's no property as 53 - pinctrl-single,bias-disable. Because pinctrl single driver could implement 54 - it by calling pulldown, pullup disabled. 55 - 56 - - pinctrl-single,input-schmitt : array of value that are used to configure 57 - input schmitt in the pinmux register. In some silicons, there're two input 58 - schmitt value (rising-edge & falling-edge) in the pinmux register. 59 - 60 - /* input schmitt value, mask */ 61 - pinctrl-single,input-schmitt = <0x30 0x70>; 62 - 63 - - pinctrl-single,input-schmitt-enable : array of value that are used to 64 - configure input schmitt enable or disable in the pinmux register. 65 - 66 - /* input, enable bits, disable bits, mask */ 67 - pinctrl-single,input-schmitt-enable = <0x30 0x40 0 0x70>; 68 - 69 - - pinctrl-single,low-power-mode : array of value that are used to configure 70 - low power mode of this pin. For some silicons, the low power mode will 71 - control the output of the pin when the pad including the pin enter low 72 - power mode. 73 - /* low power mode value, mask */ 74 - pinctrl-single,low-power-mode = <0x288 0x388>; 75 - 76 - - pinctrl-single,gpio-range : list of value that are used to configure a GPIO 77 - range. They're value of subnode phandle, pin base in pinctrl device, pin 78 - number in this range, GPIO function value of this GPIO range. 79 - The number of parameters is depend on #pinctrl-single,gpio-range-cells 80 - property. 81 - 82 - /* pin base, nr pins & gpio function */ 83 - pinctrl-single,gpio-range = <&range 0 3 0>, <&range 3 9 1>; 84 - 85 - - interrupt-controller : standard interrupt controller binding if using 86 - interrupts for wake-up events for example. In this case pinctrl-single 87 - is set up as a chained interrupt controller and the wake-up interrupts 88 - can be requested by the drivers using request_irq(). 89 - 90 - - #interrupt-cells : standard interrupt binding if using interrupts 91 - 92 - This driver assumes that there is only one register for each pin (unless the 93 - pinctrl-single,bit-per-mux is set), and uses the common pinctrl bindings as 94 - specified in the pinctrl-bindings.txt document in this directory. 95 - 96 - The pin configuration nodes for pinctrl-single are specified as pinctrl 97 - register offset and values using pinctrl-single,pins. Only the bits specified 98 - in pinctrl-single,function-mask are updated. 99 - 100 - When #pinctrl-cells = 1, then setting a pin for a device could be done with: 101 - 102 - pinctrl-single,pins = <0xdc 0x118>; 103 - 104 - Where 0xdc is the offset from the pinctrl register base address for the device 105 - pinctrl register, and 0x118 contains the desired value of the pinctrl register. 106 - 107 - When #pinctrl-cells = 2, then setting a pin for a device could be done with: 108 - 109 - pinctrl-single,pins = <0xdc 0x30 0x07>; 110 - 111 - Where 0x30 is the pin configuration value and 0x07 is the pin mux mode value. 112 - These two values are OR'd together to produce the value stored at offset 0xdc. 113 - See the device example and static board pins example below for more information. 114 - 115 - In case when one register changes more than one pin's mux the 116 - pinctrl-single,bits need to be used which takes three parameters: 117 - 118 - pinctrl-single,bits = <0xdc 0x18 0xff>; 119 - 120 - Where 0xdc is the offset from the pinctrl register base address for the 121 - device pinctrl register, 0x18 is the desired value, and 0xff is the sub mask to 122 - be used when applying this change to the register. 123 - 124 - 125 - Optional sub-node: In case some pins could be configured as GPIO in the pinmux 126 - register, those pins could be defined as a GPIO range. This sub-node is required 127 - by pinctrl-single,gpio-range property. 128 - 129 - Required properties in sub-node: 130 - - #pinctrl-single,gpio-range-cells : the number of parameters after phandle in 131 - pinctrl-single,gpio-range property. 132 - 133 - range: gpio-range { 134 - #pinctrl-single,gpio-range-cells = <3>; 135 - }; 136 - 137 - 138 - Example: 139 - 140 - /* SoC common file */ 141 - 142 - /* first controller instance for pins in core domain */ 143 - pmx_core: pinmux@4a100040 { 144 - compatible = "pinctrl-single"; 145 - reg = <0x4a100040 0x0196>; 146 - #address-cells = <1>; 147 - #size-cells = <0>; 148 - #interrupt-cells = <1>; 149 - interrupt-controller; 150 - pinctrl-single,register-width = <16>; 151 - pinctrl-single,function-mask = <0xffff>; 152 - }; 153 - 154 - /* second controller instance for pins in wkup domain */ 155 - pmx_wkup: pinmux@4a31e040 { 156 - compatible = "pinctrl-single"; 157 - reg = <0x4a31e040 0x0038>; 158 - #address-cells = <1>; 159 - #size-cells = <0>; 160 - #interrupt-cells = <1>; 161 - interrupt-controller; 162 - pinctrl-single,register-width = <16>; 163 - pinctrl-single,function-mask = <0xffff>; 164 - }; 165 - 166 - control_devconf0: pinmux@48002274 { 167 - compatible = "pinctrl-single"; 168 - reg = <0x48002274 4>; /* Single register */ 169 - #address-cells = <1>; 170 - #size-cells = <0>; 171 - pinctrl-single,bit-per-mux; 172 - pinctrl-single,register-width = <32>; 173 - pinctrl-single,function-mask = <0x5F>; 174 - }; 175 - 176 - /* third controller instance for pins in gpio domain */ 177 - pmx_gpio: pinmux@d401e000 { 178 - compatible = "pinconf-single"; 179 - reg = <0xd401e000 0x0330>; 180 - #address-cells = <1>; 181 - #size-cells = <1>; 182 - ranges; 183 - 184 - pinctrl-single,register-width = <32>; 185 - pinctrl-single,function-mask = <7>; 186 - 187 - /* sparse GPIO range could be supported */ 188 - pinctrl-single,gpio-range = <&range 0 3 0>, <&range 3 9 1>, 189 - <&range 12 1 0>, <&range 13 29 1>, 190 - <&range 43 1 0>, <&range 44 49 1>, 191 - <&range 94 1 1>, <&range 96 2 1>; 192 - 193 - range: gpio-range { 194 - #pinctrl-single,gpio-range-cells = <3>; 195 - }; 196 - }; 197 - 198 - 199 - /* board specific .dts file */ 200 - 201 - &pmx_core { 202 - 203 - /* 204 - * map all board specific static pins enabled by the pinctrl driver 205 - * itself during the boot (or just set them up in the bootloader) 206 - */ 207 - pinctrl-names = "default"; 208 - pinctrl-0 = <&board_pins>; 209 - 210 - board_pins: pinmux_board_pins { 211 - pinctrl-single,pins = < 212 - 0x6c 0xf 213 - 0x6e 0xf 214 - 0x70 0xf 215 - 0x72 0xf 216 - >; 217 - }; 218 - 219 - uart0_pins: pinmux_uart0_pins { 220 - pinctrl-single,pins = < 221 - 0x208 0 /* UART0_RXD (IOCFG138) */ 222 - 0x20c 0 /* UART0_TXD (IOCFG139) */ 223 - >; 224 - pinctrl-single,bias-pulldown = <0 2 2>; 225 - pinctrl-single,bias-pullup = <0 1 1>; 226 - }; 227 - 228 - /* map uart2 pins */ 229 - uart2_pins: pinmux_uart2_pins { 230 - pinctrl-single,pins = < 231 - 0xd8 0x118 232 - 0xda 0 233 - 0xdc 0x118 234 - 0xde 0 235 - >; 236 - }; 237 - }; 238 - 239 - &control_devconf0 { 240 - mcbsp1_pins: pinmux_mcbsp1_pins { 241 - pinctrl-single,bits = < 242 - 0x00 0x18 0x18 /* FSR/CLKR signal from FSX/CLKX pin */ 243 - >; 244 - }; 245 - 246 - mcbsp2_clks_pins: pinmux_mcbsp2_clks_pins { 247 - pinctrl-single,bits = < 248 - 0x00 0x40 0x40 /* McBSP2 CLKS from McBSP_CLKS pin */ 249 - >; 250 - }; 251 - 252 - }; 253 - 254 - &uart1 { 255 - pinctrl-names = "default"; 256 - pinctrl-0 = <&uart0_pins>; 257 - }; 258 - 259 - &uart2 { 260 - pinctrl-names = "default"; 261 - pinctrl-0 = <&uart2_pins>; 262 - };
+207
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/pinctrl-single.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Generic Pin Controller with a Single Register for One or More Pins 8 + 9 + maintainers: 10 + - Tony Lindgren <tony@atomide.com> 11 + 12 + description: 13 + Some pin controller devices use a single register for one or more pins. The 14 + range of pin control registers can vary from one to many for each controller 15 + instance. Some SoCs from Altera, Broadcom, HiSilicon, Ralink, and TI have this 16 + kind of pin controller instances. 17 + 18 + properties: 19 + compatible: 20 + oneOf: 21 + - enum: 22 + - pinctrl-single 23 + - pinconf-single 24 + - items: 25 + - enum: 26 + - ti,am437-padconf 27 + - ti,am654-padconf 28 + - ti,dra7-padconf 29 + - ti,omap2420-padconf 30 + - ti,omap2430-padconf 31 + - ti,omap3-padconf 32 + - ti,omap4-padconf 33 + - ti,omap5-padconf 34 + - const: pinctrl-single 35 + 36 + reg: 37 + maxItems: 1 38 + 39 + interrupt-controller: true 40 + 41 + '#interrupt-cells': 42 + const: 1 43 + 44 + '#address-cells': 45 + const: 1 46 + 47 + '#size-cells': 48 + const: 0 49 + 50 + '#pinctrl-cells': 51 + description: 52 + Number of cells. Usually 2, consisting of register offset, pin configuration 53 + value, and pinmux mode. Some controllers may use 1 for just offset and value. 54 + enum: [ 1, 2 ] 55 + 56 + pinctrl-single,bit-per-mux: 57 + description: Optional flag to indicate register controls more than one pin 58 + type: boolean 59 + 60 + pinctrl-single,function-mask: 61 + description: Mask of the allowed register bits 62 + $ref: /schemas/types.yaml#/definitions/uint32 63 + 64 + pinctrl-single,function-off: 65 + description: Optional function off mode for disabled state 66 + $ref: /schemas/types.yaml#/definitions/uint32 67 + 68 + pinctrl-single,register-width: 69 + description: Width of pin specific bits in the register 70 + $ref: /schemas/types.yaml#/definitions/uint32 71 + enum: [ 8, 16, 32 ] 72 + 73 + pinctrl-single,gpio-range: 74 + description: Optional list of pin base, nr pins & gpio function 75 + $ref: /schemas/types.yaml#/definitions/phandle-array 76 + items: 77 + - items: 78 + - description: phandle of a gpio-range node 79 + - description: pin base 80 + - description: number of pins 81 + - description: gpio function 82 + 83 + '#gpio-range-cells': 84 + description: No longer needed, may exist in older files for gpio-ranges 85 + deprecated: true 86 + const: 3 87 + 88 + gpio-range: 89 + description: Optional node for gpio range cells 90 + type: object 91 + additionalProperties: false 92 + properties: 93 + '#pinctrl-single,gpio-range-cells': 94 + description: Number of gpio range cells 95 + const: 3 96 + $ref: /schemas/types.yaml#/definitions/uint32 97 + 98 + patternProperties: 99 + '-pins(-[0-9]+)?$|-pin$': 100 + description: 101 + Pin group node name using naming ending in -pins followed by an optional 102 + instance number 103 + type: object 104 + additionalProperties: false 105 + 106 + properties: 107 + pinctrl-single,pins: 108 + description: 109 + Array of pins as described in pinmux-node.yaml for pinctrl-pin-array 110 + $ref: /schemas/types.yaml#/definitions/uint32-array 111 + 112 + pinctrl-single,bits: 113 + description: Register bit configuration for pinctrl-single,bit-per-mux 114 + $ref: /schemas/types.yaml#/definitions/uint32-array 115 + items: 116 + - description: register offset 117 + - description: value 118 + - description: pin bitmask in the register 119 + 120 + pinctrl-single,bias-pullup: 121 + description: Optional bias pull up configuration 122 + $ref: /schemas/types.yaml#/definitions/uint32-array 123 + items: 124 + - description: input 125 + - description: enabled pull up bits 126 + - description: disabled pull up bits 127 + - description: bias pull up mask 128 + 129 + pinctrl-single,bias-pulldown: 130 + description: Optional bias pull down configuration 131 + $ref: /schemas/types.yaml#/definitions/uint32-array 132 + items: 133 + - description: input 134 + - description: enabled pull down bits 135 + - description: disabled pull down bits 136 + - description: bias pull down mask 137 + 138 + pinctrl-single,drive-strength: 139 + description: Optional drive strength configuration 140 + $ref: /schemas/types.yaml#/definitions/uint32-array 141 + items: 142 + - description: drive strength current 143 + - description: drive strength mask 144 + 145 + pinctrl-single,input-schmitt: 146 + description: Optional input schmitt configuration 147 + $ref: /schemas/types.yaml#/definitions/uint32-array 148 + items: 149 + - description: input 150 + - description: enable bits 151 + - description: disable bits 152 + - description: input schmitt mask 153 + 154 + pinctrl-single,low-power-mode: 155 + description: Optional low power mode configuration 156 + $ref: /schemas/types.yaml#/definitions/uint32-array 157 + items: 158 + - description: low power mode value 159 + - description: low power mode mask 160 + 161 + pinctrl-single,slew-rate: 162 + description: Optional slew rate configuration 163 + $ref: /schemas/types.yaml#/definitions/uint32-array 164 + items: 165 + - description: slew rate 166 + - description: slew rate mask 167 + 168 + allOf: 169 + - $ref: pinctrl.yaml# 170 + 171 + required: 172 + - compatible 173 + - reg 174 + - pinctrl-single,register-width 175 + 176 + additionalProperties: false 177 + 178 + examples: 179 + - | 180 + soc { 181 + #address-cells = <1>; 182 + #size-cells = <1>; 183 + 184 + pinmux@4a100040 { 185 + compatible = "pinctrl-single"; 186 + reg = <0x4a100040 0x0196>; 187 + #address-cells = <1>; 188 + #size-cells = <0>; 189 + #pinctrl-cells = <2>; 190 + #interrupt-cells = <1>; 191 + interrupt-controller; 192 + pinctrl-single,register-width = <16>; 193 + pinctrl-single,function-mask = <0xffff>; 194 + pinctrl-single,gpio-range = <&range 0 3 0>; 195 + range: gpio-range { 196 + #pinctrl-single,gpio-range-cells = <3>; 197 + }; 198 + 199 + uart2-pins { 200 + pinctrl-single,pins = 201 + <0xd8 0x118>, 202 + <0xda 0>, 203 + <0xdc 0x118>, 204 + <0xde 0>; 205 + }; 206 + }; 207 + };
+8
Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
··· 26 26 - qcom,pm6350-gpio 27 27 - qcom,pm7250b-gpio 28 28 - qcom,pm7325-gpio 29 + - qcom,pm7550ba-gpio 29 30 - qcom,pm8005-gpio 30 31 - qcom,pm8008-gpio 31 32 - qcom,pm8018-gpio ··· 54 53 - qcom,pm8994-gpio 55 54 - qcom,pm8998-gpio 56 55 - qcom,pma8084-gpio 56 + - qcom,pmc8180-gpio 57 + - qcom,pmc8180c-gpio 57 58 - qcom,pmi632-gpio 58 59 - qcom,pmi8950-gpio 59 60 - qcom,pmi8994-gpio ··· 71 68 - qcom,pms405-gpio 72 69 - qcom,pmx55-gpio 73 70 - qcom,pmx65-gpio 71 + - qcom,pmx75-gpio 74 72 75 73 - enum: 76 74 - qcom,spmi-gpio ··· 176 172 compatible: 177 173 contains: 178 174 enum: 175 + - qcom,pm7550ba-gpio 179 176 - qcom,pm8226-gpio 180 177 - qcom,pm8350b-gpio 181 178 - qcom,pm8550ve-gpio ··· 306 301 contains: 307 302 enum: 308 303 - qcom,pmx65-gpio 304 + - qcom,pmx75-gpio 309 305 then: 310 306 properties: 311 307 gpio-line-names: ··· 419 413 - gpio1-gpio9 for pm6350 420 414 - gpio1-gpio12 for pm7250b 421 415 - gpio1-gpio10 for pm7325 416 + - gpio1-gpio8 for pm7550ba 422 417 - gpio1-gpio4 for pm8005 423 418 - gpio1-gpio2 for pm8008 424 419 - gpio1-gpio6 for pm8018 ··· 463 456 - gpio1-gpio11 for pmx55 (holes on gpio3, gpio7, gpio10 464 457 and gpio11) 465 458 - gpio1-gpio16 for pmx65 459 + - gpio1-gpio16 for pmx75 466 460 467 461 items: 468 462 pattern: "^gpio([0-9]+)$"
-5
Documentation/devicetree/bindings/pinctrl/qcom,sc7280-lpass-lpi-pinctrl.yaml
··· 17 17 compatible: 18 18 const: qcom,sc7280-lpass-lpi-pinctrl 19 19 20 - qcom,adsp-bypass-mode: 21 - description: 22 - Tells ADSP is in bypass mode. 23 - type: boolean 24 - 25 20 reg: 26 21 maxItems: 2 27 22
+135
Documentation/devicetree/bindings/pinctrl/qcom,sm6115-lpass-lpi-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/qcom,sm6115-lpass-lpi-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm SM6115 SoC LPASS LPI TLMM 8 + 9 + maintainers: 10 + - Konrad Dybcio <konradybcio@kernel.org> 11 + - Srinivas Kandagatla <srinivas.kandagatla@linaro.org> 12 + 13 + description: 14 + Top Level Mode Multiplexer pin controller in the Low Power Audio SubSystem 15 + (LPASS) Low Power Island (LPI) of Qualcomm SM6115 SoC. 16 + 17 + properties: 18 + compatible: 19 + const: qcom,sm6115-lpass-lpi-pinctrl 20 + 21 + reg: 22 + items: 23 + - description: LPASS LPI TLMM Control and Status registers 24 + - description: LPASS LPI MCC registers 25 + 26 + clocks: 27 + items: 28 + - description: LPASS Audio voting clock 29 + 30 + clock-names: 31 + items: 32 + - const: audio 33 + 34 + gpio-controller: true 35 + 36 + "#gpio-cells": 37 + description: Specifying the pin number and flags, as defined in 38 + include/dt-bindings/gpio/gpio.h 39 + const: 2 40 + 41 + gpio-ranges: 42 + maxItems: 1 43 + 44 + patternProperties: 45 + "-state$": 46 + oneOf: 47 + - $ref: "#/$defs/qcom-sm6115-lpass-state" 48 + - patternProperties: 49 + "-pins$": 50 + $ref: "#/$defs/qcom-sm6115-lpass-state" 51 + additionalProperties: false 52 + 53 + $defs: 54 + qcom-sm6115-lpass-state: 55 + type: object 56 + description: 57 + Pinctrl node's client devices use subnodes for desired pin configuration. 58 + Client device subnodes use below standard properties. 59 + $ref: /schemas/pinctrl/pincfg-node.yaml 60 + 61 + properties: 62 + pins: 63 + description: 64 + List of gpio pins affected by the properties specified in this 65 + subnode. 66 + items: 67 + pattern: "^gpio([0-9]|1[0-8])$" 68 + 69 + function: 70 + enum: [ dmic01_clk, dmic01_data, dmic23_clk, dmic23_data, gpio, i2s1_clk, 71 + i2s1_data, i2s1_ws, i2s2_clk, i2s2_data, i2s2_ws, i2s3_clk, 72 + i2s3_data, i2s3_ws, qua_mi2s_data, qua_mi2s_sclk, qua_mi2s_ws, 73 + swr_rx_clk, swr_rx_data, swr_tx_clk, swr_tx_data, wsa_mclk ] 74 + description: 75 + Specify the alternative function to be configured for the specified 76 + pins. 77 + 78 + drive-strength: 79 + enum: [2, 4, 6, 8, 10, 12, 14, 16] 80 + default: 2 81 + description: 82 + Selects the drive strength for the specified pins, in mA. 83 + 84 + slew-rate: 85 + enum: [0, 1, 2, 3] 86 + default: 0 87 + description: | 88 + 0: No adjustments 89 + 1: Higher Slew rate (faster edges) 90 + 2: Lower Slew rate (slower edges) 91 + 3: Reserved (No adjustments) 92 + 93 + bias-bus-hold: true 94 + bias-pull-down: true 95 + bias-pull-up: true 96 + bias-disable: true 97 + input-enable: true 98 + output-high: true 99 + output-low: true 100 + 101 + required: 102 + - pins 103 + - function 104 + 105 + additionalProperties: false 106 + 107 + allOf: 108 + - $ref: pinctrl.yaml# 109 + 110 + required: 111 + - compatible 112 + - reg 113 + - clocks 114 + - clock-names 115 + - gpio-controller 116 + - "#gpio-cells" 117 + - gpio-ranges 118 + 119 + additionalProperties: false 120 + 121 + examples: 122 + - | 123 + #include <dt-bindings/sound/qcom,q6afe.h> 124 + 125 + lpass_tlmm: pinctrl@a7c0000 { 126 + compatible = "qcom,sm6115-lpass-lpi-pinctrl"; 127 + reg = <0x0a7c0000 0x20000>, 128 + <0x0a950000 0x10000>; 129 + clocks = <&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>; 130 + clock-names = "audio"; 131 + 132 + gpio-controller; 133 + #gpio-cells = <2>; 134 + gpio-ranges = <&lpass_tlmm 0 0 19>; 135 + };
+143
Documentation/devicetree/bindings/pinctrl/qcom,sm8350-lpass-lpi-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/qcom,sm8350-lpass-lpi-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm SM8350 SoC LPASS LPI TLMM 8 + 9 + maintainers: 10 + - Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 11 + - Srinivas Kandagatla <srinivas.kandagatla@linaro.org> 12 + 13 + description: 14 + Top Level Mode Multiplexer pin controller in the Low Power Audio SubSystem 15 + (LPASS) Low Power Island (LPI) of Qualcomm SM8350 SoC. 16 + 17 + properties: 18 + compatible: 19 + const: qcom,sm8350-lpass-lpi-pinctrl 20 + 21 + reg: 22 + items: 23 + - description: LPASS LPI TLMM Control and Status registers 24 + - description: LPASS LPI MCC registers 25 + 26 + clocks: 27 + items: 28 + - description: LPASS Core voting clock 29 + - description: LPASS Audio voting clock 30 + 31 + clock-names: 32 + items: 33 + - const: core 34 + - const: audio 35 + 36 + gpio-controller: true 37 + 38 + "#gpio-cells": 39 + description: Specifying the pin number and flags, as defined in 40 + include/dt-bindings/gpio/gpio.h 41 + const: 2 42 + 43 + gpio-ranges: 44 + maxItems: 1 45 + 46 + patternProperties: 47 + "-state$": 48 + oneOf: 49 + - $ref: "#/$defs/qcom-sm8350-lpass-state" 50 + - patternProperties: 51 + "-pins$": 52 + $ref: "#/$defs/qcom-sm8350-lpass-state" 53 + additionalProperties: false 54 + 55 + $defs: 56 + qcom-sm8350-lpass-state: 57 + type: object 58 + description: 59 + Pinctrl node's client devices use subnodes for desired pin configuration. 60 + Client device subnodes use below standard properties. 61 + $ref: /schemas/pinctrl/pincfg-node.yaml 62 + 63 + properties: 64 + pins: 65 + description: 66 + List of gpio pins affected by the properties specified in this 67 + subnode. 68 + items: 69 + pattern: "^gpio([0-9]|1[0-9]|2[0-2])$" 70 + 71 + function: 72 + enum: [ dmic1_clk, dmic1_data, dmic2_clk, dmic2_data, dmic3_clk, 73 + dmic3_data, dmic4_clk, dmic4_data, ext_mclk1_a, ext_mclk1_b, 74 + ext_mclk1_c, ext_mclk1_d, ext_mclk1_e, gpio, i2s0_clk, 75 + i2s0_data, i2s0_ws, i2s1_clk, i2s1_data, i2s1_ws, i2s2_clk, 76 + i2s2_data, i2s2_ws, i2s3_clk, i2s3_data, i2s3_ws, i2s4_clk, 77 + i2s4_data, i2s4_ws, slimbus_clk, slimbus_data, swr_rx_clk, 78 + swr_rx_data, swr_tx_clk, swr_tx_data, wsa_swr_clk, 79 + wsa_swr_data, wsa2_swr_clk, wsa2_swr_data ] 80 + description: 81 + Specify the alternative function to be configured for the specified 82 + pins. 83 + 84 + drive-strength: 85 + enum: [2, 4, 6, 8, 10, 12, 14, 16] 86 + default: 2 87 + description: 88 + Selects the drive strength for the specified pins, in mA. 89 + 90 + slew-rate: 91 + enum: [0, 1, 2, 3] 92 + default: 0 93 + description: | 94 + 0: No adjustments 95 + 1: Higher Slew rate (faster edges) 96 + 2: Lower Slew rate (slower edges) 97 + 3: Reserved (No adjustments) 98 + 99 + bias-bus-hold: true 100 + bias-pull-down: true 101 + bias-pull-up: true 102 + bias-disable: true 103 + input-enable: true 104 + output-high: true 105 + output-low: true 106 + 107 + required: 108 + - pins 109 + - function 110 + 111 + additionalProperties: false 112 + 113 + allOf: 114 + - $ref: pinctrl.yaml# 115 + 116 + required: 117 + - compatible 118 + - reg 119 + - clocks 120 + - clock-names 121 + - gpio-controller 122 + - "#gpio-cells" 123 + - gpio-ranges 124 + 125 + additionalProperties: false 126 + 127 + examples: 128 + - | 129 + #include <dt-bindings/sound/qcom,q6afe.h> 130 + 131 + lpass_tlmm: pinctrl@33c0000 { 132 + compatible = "qcom,sm8350-lpass-lpi-pinctrl"; 133 + reg = <0x033c0000 0x20000>, 134 + <0x03550000 0x10000>; 135 + 136 + clocks = <&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, 137 + <&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>; 138 + clock-names = "core", "audio"; 139 + 140 + gpio-controller; 141 + #gpio-cells = <2>; 142 + gpio-ranges = <&lpass_tlmm 0 0 15>; 143 + };
-4
Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml
··· 107 107 Client device subnodes use below standard properties. 108 108 109 109 properties: 110 - phandle: true 111 110 function: true 112 111 groups: true 113 112 pins: true ··· 126 127 additionalProperties: false 127 128 128 129 - type: object 129 - properties: 130 - phandle: true 131 - 132 130 additionalProperties: 133 131 $ref: "#/additionalProperties/anyOf/0" 134 132
-4
Documentation/devicetree/bindings/pinctrl/renesas,rza1-ports.yaml
··· 108 108 Integers values in "pinmux" argument list are assembled as: 109 109 ((PORT * 16 + PIN) | MUX_FUNC << 16) 110 110 111 - phandle: true 112 111 input-enable: true 113 112 output-enable: true 114 113 ··· 117 118 additionalProperties: false 118 119 119 120 - type: object 120 - properties: 121 - phandle: true 122 - 123 121 additionalProperties: 124 122 $ref: "#/additionalProperties/anyOf/0" 125 123
+28 -33
Documentation/devicetree/bindings/pinctrl/renesas,rza2-pinctrl.yaml
··· 37 37 gpio-ranges: 38 38 maxItems: 1 39 39 40 - patternProperties: 41 - "^.*$": 42 - if: 43 - type: object 44 - then: 45 - allOf: 46 - - $ref: pincfg-node.yaml# 47 - - $ref: pinmux-node.yaml# 40 + additionalProperties: 41 + type: object 42 + 43 + allOf: 44 + - $ref: pincfg-node.yaml# 45 + - $ref: pinmux-node.yaml# 46 + 47 + description: 48 + The child nodes of the pin controller designate pins to be used for 49 + specific peripheral functions or as GPIO. 50 + 51 + A pin multiplexing sub-node describes how to configure a set of 52 + (or a single) pin in some desired alternate function mode. 53 + The values for the pinmux properties are a combination of port name, 54 + pin number and the desired function index. Use the RZA2_PINMUX macro 55 + located in include/dt-bindings/pinctrl/r7s9210-pinctrl.h to easily 56 + define these. 57 + For assigning GPIO pins, use the macro RZA2_PIN also in 58 + to express the desired port pin. 59 + 60 + properties: 61 + pinmux: 48 62 description: 49 - The child nodes of the pin controller designate pins to be used for 50 - specific peripheral functions or as GPIO. 63 + Values are constructed from GPIO port number, pin number, and 64 + alternate function configuration number using the RZA2_PINMUX() 65 + helper macro in r7s9210-pinctrl.h. 51 66 52 - A pin multiplexing sub-node describes how to configure a set of 53 - (or a single) pin in some desired alternate function mode. 54 - The values for the pinmux properties are a combination of port name, 55 - pin number and the desired function index. Use the RZA2_PINMUX macro 56 - located in include/dt-bindings/pinctrl/r7s9210-pinctrl.h to easily 57 - define these. 58 - For assigning GPIO pins, use the macro RZA2_PIN also in 59 - to express the desired port pin. 67 + required: 68 + - pinmux 60 69 61 - properties: 62 - phandle: true 63 - 64 - pinmux: 65 - description: 66 - Values are constructed from GPIO port number, pin number, and 67 - alternate function configuration number using the RZA2_PINMUX() 68 - helper macro in r7s9210-pinctrl.h. 69 - 70 - required: 71 - - pinmux 72 - 73 - additionalProperties: false 70 + additionalProperties: false 74 71 75 72 allOf: 76 73 - $ref: pinctrl.yaml# ··· 78 81 - gpio-controller 79 82 - '#gpio-cells' 80 83 - gpio-ranges 81 - 82 - additionalProperties: false 83 84 84 85 examples: 85 86 - |
-4
Documentation/devicetree/bindings/pinctrl/renesas,rzg2l-pinctrl.yaml
··· 83 83 Client device subnodes use below standard properties. 84 84 85 85 properties: 86 - phandle: true 87 86 pinmux: 88 87 description: 89 88 Values are constructed from GPIO port number, pin number, and ··· 105 106 line-name: true 106 107 107 108 - type: object 108 - properties: 109 - phandle: true 110 - 111 109 additionalProperties: 112 110 $ref: "#/additionalProperties/anyOf/0" 113 111
-4
Documentation/devicetree/bindings/pinctrl/renesas,rzn1-pinctrl.yaml
··· 74 74 offset by 10. Additional identifiers are provided to specify the 75 75 MDIO source peripheral. 76 76 77 - phandle: true 78 77 bias-disable: true 79 78 bias-pull-up: 80 79 description: Pull up the pin with 50 kOhm ··· 90 91 $ref: "#/additionalProperties/anyOf/0" 91 92 92 93 - type: object 93 - properties: 94 - phandle: true 95 - 96 94 additionalProperties: 97 95 $ref: "#/additionalProperties/anyOf/0" 98 96
-4
Documentation/devicetree/bindings/pinctrl/renesas,rzv2m-pinctrl.yaml
··· 63 63 Client device subnodes use below standard properties. 64 64 65 65 properties: 66 - phandle: true 67 66 pinmux: 68 67 description: 69 68 Values are constructed from GPIO port number, pin number, and ··· 86 87 line-name: true 87 88 88 89 - type: object 89 - properties: 90 - phandle: true 91 - 92 90 additionalProperties: 93 91 $ref: "#/additionalProperties/anyOf/0" 94 92
-2
Documentation/devicetree/bindings/pinctrl/socionext,uniphier-pinctrl.yaml
··· 32 32 - $ref: pinmux-node.yaml# 33 33 34 34 properties: 35 - phandle: true 36 35 function: true 37 36 groups: true 38 37 pins: true ··· 48 49 - $ref: pinmux-node.yaml# 49 50 50 51 properties: 51 - phandle: true 52 52 function: true 53 53 groups: true 54 54 pins: true
-13
Documentation/devicetree/bindings/pinctrl/ti,omap-pinctrl.txt
··· 1 - OMAP Pinctrl definitions 2 - 3 - Required properties: 4 - - compatible : Should be one of: 5 - "ti,omap2420-padconf" - OMAP2420 compatible pinctrl 6 - "ti,omap2430-padconf" - OMAP2430 compatible pinctrl 7 - "ti,omap3-padconf" - OMAP3 compatible pinctrl 8 - "ti,omap4-padconf" - OMAP4 compatible pinctrl 9 - "ti,omap5-padconf" - OMAP5 compatible pinctrl 10 - "ti,dra7-padconf" - DRA7 compatible pinctrl 11 - "ti,am437-padconf" - AM437x compatible pinctrl 12 - 13 - See Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt for further details.
+4
Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml
··· 273 273 slew-rate: 274 274 enum: [0, 1] 275 275 276 + output-enable: 277 + description: 278 + This will internally disable the tri-state for MIO pins. 279 + 276 280 drive-strength: 277 281 description: 278 282 Selects the drive strength for MIO pins, in mA.
+1 -1
arch/arm/boot/dts/st/ste-href520-tvk.dts
··· 28 28 2900000 0x0>; 29 29 30 30 gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; 31 - enable-gpio = <&gpio2 14 GPIO_ACTIVE_HIGH>; 31 + enable-gpios = <&gpio2 14 GPIO_ACTIVE_HIGH>; 32 32 enable-active-high; 33 33 34 34 pinctrl-names = "default";
+1 -1
arch/arm/boot/dts/st/ste-hrefprev60-stuib.dts
··· 27 27 2900000 0x0>; 28 28 29 29 gpios = <&tc3589x_gpio 18 GPIO_ACTIVE_HIGH>; 30 - enable-gpio = <&tc3589x_gpio 17 GPIO_ACTIVE_HIGH>; 30 + enable-gpios = <&tc3589x_gpio 17 GPIO_ACTIVE_HIGH>; 31 31 enable-active-high; 32 32 }; 33 33
+1 -1
arch/arm/boot/dts/st/ste-hrefprev60-tvk.dts
··· 27 27 2900000 0x0>; 28 28 29 29 gpios = <&tc3589x_gpio 18 GPIO_ACTIVE_HIGH>; 30 - enable-gpio = <&tc3589x_gpio 17 GPIO_ACTIVE_HIGH>; 30 + enable-gpios = <&tc3589x_gpio 17 GPIO_ACTIVE_HIGH>; 31 31 enable-active-high; 32 32 }; 33 33 };
+1 -1
arch/arm/boot/dts/st/ste-hrefv60plus-stuib.dts
··· 29 29 2900000 0x0>; 30 30 31 31 gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; 32 - enable-gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>; 32 + enable-gpios = <&gpio5 9 GPIO_ACTIVE_HIGH>; 33 33 enable-active-high; 34 34 35 35 pinctrl-names = "default";
+1 -1
arch/arm/boot/dts/st/ste-hrefv60plus-tvk.dts
··· 29 29 2900000 0x0>; 30 30 31 31 gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; 32 - enable-gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>; 32 + enable-gpios = <&gpio5 9 GPIO_ACTIVE_HIGH>; 33 33 enable-active-high; 34 34 35 35 pinctrl-names = "default";
+1 -1
arch/arm/boot/dts/st/ste-snowball.dts
··· 229 229 /* GPIO228 SD_SEL */ 230 230 gpios = <&gpio7 4 GPIO_ACTIVE_HIGH>; 231 231 /* GPIO217 MMC_EN */ 232 - enable-gpio = <&gpio6 25 GPIO_ACTIVE_HIGH>; 232 + enable-gpios = <&gpio6 25 GPIO_ACTIVE_HIGH>; 233 233 enable-active-high; 234 234 235 235 regulator-min-microvolt = <1800000>;
+1
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
··· 9 9 #include <dt-bindings/clock/g12a-aoclkc.h> 10 10 #include <dt-bindings/interrupt-controller/irq.h> 11 11 #include <dt-bindings/interrupt-controller/arm-gic.h> 12 + #include <dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h> 12 13 #include <dt-bindings/reset/amlogic,meson-g12a-reset.h> 13 14 #include <dt-bindings/thermal/thermal.h> 14 15
+1 -1
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
··· 343 343 344 344 interrupt-parent = <&gpio_intc>; 345 345 /* MAC_INTR on GPIOZ_14 */ 346 - interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 346 + interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>; 347 347 }; 348 348 }; 349 349
+1 -1
arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi
··· 201 201 202 202 interrupt-parent = <&gpio_intc>; 203 203 /* MAC_INTR on GPIOZ_14 */ 204 - interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 204 + interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>; 205 205 }; 206 206 }; 207 207
+1 -1
arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi
··· 325 325 326 326 interrupt-parent = <&gpio_intc>; 327 327 /* MAC_INTR on GPIOZ_14 */ 328 - interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 328 + interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>; 329 329 }; 330 330 }; 331 331
+2 -2
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
··· 380 380 compatible = "rockchip,rk818"; 381 381 reg = <0x1c>; 382 382 interrupt-parent = <&gpio_intc>; 383 - interrupts = <7 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_7 */ 383 + interrupts = <IRQID_GPIOAO_7 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_7 */ 384 384 #clock-cells = <1>; 385 385 386 386 vcc1-supply = <&vdd_sys>; ··· 519 519 reg = <0x20>; 520 520 interrupt-parent = <&gpio_intc>; 521 521 522 - interrupts = <5 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_5 */ 522 + interrupts = <IRQID_GPIOAO_5 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_5 */ 523 523 524 524 vcc1-supply = <&vdd_sys>; 525 525 vcc2-supply = <&vdd_sys>;
+1 -1
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
··· 184 184 185 185 interrupt-parent = <&gpio_intc>; 186 186 /* MAC_INTR on GPIOZ_14 */ 187 - interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 187 + interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>; 188 188 }; 189 189 }; 190 190
+1 -1
arch/arm64/boot/dts/amlogic/meson-g12b-w400.dtsi
··· 269 269 270 270 interrupt-parent = <&gpio_intc>; 271 271 /* MAC_INTR on GPIOZ_14 */ 272 - interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 272 + interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>; 273 273 }; 274 274 }; 275 275
+1 -1
arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts
··· 99 99 100 100 interrupt-parent = <&gpio_intc>; 101 101 /* MAC_INTR on GPIOZ_14 */ 102 - interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 102 + interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>; 103 103 }; 104 104 }; 105 105
+2 -2
arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi
··· 45 45 linux,code = <BTN_1>; 46 46 gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>; 47 47 interrupt-parent = <&gpio_intc>; 48 - interrupts = <3 IRQ_TYPE_EDGE_BOTH>; 48 + interrupts = <IRQID_GPIOAO_3 IRQ_TYPE_EDGE_BOTH>; 49 49 }; 50 50 }; 51 51 ··· 217 217 218 218 interrupt-parent = <&gpio_intc>; 219 219 /* MAC_INTR on GPIOZ_14 */ 220 - interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 220 + interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>; 221 221 }; 222 222 }; 223 223
+1 -1
arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts
··· 99 99 100 100 interrupt-parent = <&gpio_intc>; 101 101 /* MAC_INTR on GPIOZ_14 */ 102 - interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 102 + interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>; 103 103 }; 104 104 }; 105 105
+1 -1
arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
··· 282 282 283 283 interrupt-parent = <&gpio_intc>; 284 284 /* MAC_INTR on GPIOZ_14 */ 285 - interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 285 + interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>; 286 286 }; 287 287 }; 288 288
+6 -6
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
··· 53 53 linux,code = <BTN_0>; 54 54 gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW>; 55 55 interrupt-parent = <&gpio_intc>; 56 - interrupts = <34 IRQ_TYPE_EDGE_BOTH>; 56 + interrupts = <IRQID_GPIOH_6 IRQ_TYPE_EDGE_BOTH>; 57 57 }; 58 58 59 59 key-2 { ··· 61 61 linux,code = <BTN_1>; 62 62 gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>; 63 63 interrupt-parent = <&gpio_intc>; 64 - interrupts = <35 IRQ_TYPE_EDGE_BOTH>; 64 + interrupts = <IRQID_GPIOH_7 IRQ_TYPE_EDGE_BOTH>; 65 65 }; 66 66 67 67 key-3 { ··· 69 69 linux,code = <BTN_2>; 70 70 gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; 71 71 interrupt-parent = <&gpio_intc>; 72 - interrupts = <2 IRQ_TYPE_EDGE_BOTH>; 72 + interrupts = <IRQID_GPIOAO_2 IRQ_TYPE_EDGE_BOTH>; 73 73 }; 74 74 75 75 key-mic-mute { ··· 78 78 linux,input-type = <EV_SW>; 79 79 gpios = <&gpio_ao GPIOE_2 GPIO_ACTIVE_LOW>; 80 80 interrupt-parent = <&gpio_intc>; 81 - interrupts = <99 IRQ_TYPE_EDGE_BOTH>; 81 + interrupts = <IRQID_GPIOE_2 IRQ_TYPE_EDGE_BOTH>; 82 82 }; 83 83 84 84 key-power { ··· 86 86 linux,code = <KEY_POWER>; 87 87 gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>; 88 88 interrupt-parent = <&gpio_intc>; 89 - interrupts = <3 IRQ_TYPE_EDGE_BOTH>; 89 + interrupts = <IRQID_GPIOAO_3 IRQ_TYPE_EDGE_BOTH>; 90 90 }; 91 91 }; 92 92 ··· 582 582 bluetooth { 583 583 compatible = "brcm,bcm43438-bt"; 584 584 interrupt-parent = <&gpio_intc>; 585 - interrupts = <95 IRQ_TYPE_LEVEL_HIGH>; 585 + interrupts = <IRQID_GPIOX_18 IRQ_TYPE_LEVEL_HIGH>; 586 586 interrupt-names = "host-wakeup"; 587 587 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 588 588 max-speed = <2000000>;
+1 -1
arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-gbit.dts
··· 99 99 100 100 interrupt-parent = <&gpio_intc>; 101 101 /* MAC_INTR on GPIOZ_14 */ 102 - interrupts = <26 IRQ_TYPE_LEVEL_LOW>; 102 + interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>; 103 103 }; 104 104 }; 105 105
+49
drivers/firmware/xilinx/zynqmp.c
··· 340 340 341 341 static u32 pm_api_version; 342 342 static u32 pm_tz_version; 343 + static u32 pm_family_code; 344 + static u32 pm_sub_family_code; 343 345 344 346 int zynqmp_pm_register_sgi(u32 sgi_num, u32 reset) 345 347 { ··· 406 404 return ret; 407 405 } 408 406 EXPORT_SYMBOL_GPL(zynqmp_pm_get_chipid); 407 + 408 + /** 409 + * zynqmp_pm_get_family_info() - Get family info of platform 410 + * @family: Returned family code value 411 + * @subfamily: Returned sub-family code value 412 + * 413 + * Return: Returns status, either success or error+reason 414 + */ 415 + static int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily) 416 + { 417 + u32 ret_payload[PAYLOAD_ARG_CNT]; 418 + u32 idcode; 419 + int ret; 420 + 421 + /* Check is family or sub-family code already received */ 422 + if (pm_family_code && pm_sub_family_code) { 423 + *family = pm_family_code; 424 + *subfamily = pm_sub_family_code; 425 + return 0; 426 + } 427 + 428 + ret = zynqmp_pm_invoke_fn(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload); 429 + if (ret < 0) 430 + return ret; 431 + 432 + idcode = ret_payload[1]; 433 + pm_family_code = FIELD_GET(FAMILY_CODE_MASK, idcode); 434 + pm_sub_family_code = FIELD_GET(SUB_FAMILY_CODE_MASK, idcode); 435 + *family = pm_family_code; 436 + *subfamily = pm_sub_family_code; 437 + 438 + return 0; 439 + } 409 440 410 441 /** 411 442 * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version ··· 1157 1122 int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, 1158 1123 u32 value) 1159 1124 { 1125 + int ret; 1126 + 1127 + if (pm_family_code == ZYNQMP_FAMILY_CODE && 1128 + param == PM_PINCTRL_CONFIG_TRI_STATE) { 1129 + ret = zynqmp_pm_feature(PM_PINCTRL_CONFIG_PARAM_SET); 1130 + if (ret < PM_PINCTRL_PARAM_SET_VERSION) 1131 + return -EOPNOTSUPP; 1132 + } 1133 + 1160 1134 return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, pin, 1161 1135 param, value, 0, NULL); 1162 1136 } ··· 1963 1919 1964 1920 pr_info("%s Platform Management API v%d.%d\n", __func__, 1965 1921 pm_api_version >> 16, pm_api_version & 0xFFFF); 1922 + 1923 + /* Get the Family code and sub family code of platform */ 1924 + ret = zynqmp_pm_get_family_info(&pm_family_code, &pm_sub_family_code); 1925 + if (ret < 0) 1926 + return ret; 1966 1927 1967 1928 /* Check trustzone version number */ 1968 1929 ret = zynqmp_pm_get_trustzone_version(&pm_tz_version);
-11
drivers/pinctrl/Kconfig
··· 355 355 356 356 If conpiled as a module, the module name will be pinctrl-ocelot. 357 357 358 - config PINCTRL_OXNAS 359 - bool 360 - depends on OF 361 - select PINMUX 362 - select PINCONF 363 - select GENERIC_PINCONF 364 - select GPIOLIB 365 - select OF_GPIO 366 - select GPIOLIB_IRQCHIP 367 - select MFD_SYSCON 368 - 369 358 config PINCTRL_PALMAS 370 359 tristate "Pinctrl driver for the PALMAS Series MFD devices" 371 360 depends on OF && MFD_PALMAS
-1
drivers/pinctrl/Makefile
··· 38 38 obj-$(CONFIG_PINCTRL_MICROCHIP_SGPIO) += pinctrl-microchip-sgpio.o 39 39 obj-$(CONFIG_PINCTRL_MLXBF3) += pinctrl-mlxbf3.o 40 40 obj-$(CONFIG_PINCTRL_OCELOT) += pinctrl-ocelot.o 41 - obj-$(CONFIG_PINCTRL_OXNAS) += pinctrl-oxnas.o 42 41 obj-$(CONFIG_PINCTRL_PALMAS) += pinctrl-palmas.o 43 42 obj-$(CONFIG_PINCTRL_PIC32) += pinctrl-pic32.o 44 43 obj-$(CONFIG_PINCTRL_PISTACHIO) += pinctrl-pistachio.o
+4 -6
drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
··· 21 21 #include <linux/io.h> 22 22 #include <linux/ioport.h> 23 23 #include <linux/kernel.h> 24 - #include <linux/of_device.h> 25 - #include <linux/of_irq.h> 24 + #include <linux/of.h> 25 + #include <linux/platform_device.h> 26 26 #include <linux/seq_file.h> 27 27 #include <linux/slab.h> 28 28 ··· 891 891 } 892 892 893 893 ret = gpiochip_add_data(gc, chip); 894 - if (ret < 0) { 895 - dev_err(dev, "unable to add GPIO chip\n"); 896 - return ret; 897 - } 894 + if (ret < 0) 895 + return dev_err_probe(dev, ret, "unable to add GPIO chip\n"); 898 896 899 897 if (!no_pinconf) { 900 898 ret = iproc_gpio_register_pinconf(chip);
+4 -7
drivers/pinctrl/bcm/pinctrl-nsp-gpio.c
··· 15 15 #include <linux/io.h> 16 16 #include <linux/ioport.h> 17 17 #include <linux/kernel.h> 18 - #include <linux/of_address.h> 19 - #include <linux/of_device.h> 20 - #include <linux/of_irq.h> 18 + #include <linux/of.h> 21 19 #include <linux/pinctrl/pinconf.h> 22 20 #include <linux/pinctrl/pinconf-generic.h> 23 21 #include <linux/pinctrl/pinctrl.h> 22 + #include <linux/platform_device.h> 24 23 #include <linux/slab.h> 25 24 26 25 #include "../pinctrl-utils.h" ··· 685 686 } 686 687 687 688 ret = devm_gpiochip_add_data(dev, gc, chip); 688 - if (ret < 0) { 689 - dev_err(dev, "unable to add GPIO chip\n"); 690 - return ret; 691 - } 689 + if (ret < 0) 690 + return dev_err_probe(dev, ret, "unable to add GPIO chip\n"); 692 691 693 692 ret = nsp_gpio_register_pinconf(chip); 694 693 if (ret) {
+1 -2
drivers/pinctrl/berlin/pinctrl-as370.c
··· 341 341 if (!rmconfig) 342 342 return -ENOMEM; 343 343 344 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 345 - base = devm_ioremap_resource(&pdev->dev, res); 344 + base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); 346 345 if (IS_ERR(base)) 347 346 return PTR_ERR(base); 348 347
+15 -5
drivers/pinctrl/core.c
··· 205 205 const struct pinctrl_pin_desc *pin) 206 206 { 207 207 struct pin_desc *pindesc; 208 + int error; 208 209 209 210 pindesc = pin_desc_get(pctldev, pin->number); 210 211 if (pindesc) { ··· 227 226 } else { 228 227 pindesc->name = kasprintf(GFP_KERNEL, "PIN%u", pin->number); 229 228 if (!pindesc->name) { 230 - kfree(pindesc); 231 - return -ENOMEM; 229 + error = -ENOMEM; 230 + goto failed; 232 231 } 233 232 pindesc->dynamic_name = true; 234 233 } 235 234 236 235 pindesc->drv_data = pin->drv_data; 237 236 238 - radix_tree_insert(&pctldev->pin_desc_tree, pin->number, pindesc); 237 + error = radix_tree_insert(&pctldev->pin_desc_tree, pin->number, pindesc); 238 + if (error) 239 + goto failed; 240 + 239 241 pr_debug("registered pin %d (%s) on %s\n", 240 242 pin->number, pindesc->name, pctldev->desc->name); 241 243 return 0; 244 + 245 + failed: 246 + kfree(pindesc); 247 + return error; 242 248 } 243 249 244 250 static int pinctrl_register_pins(struct pinctrl_dev *pctldev, ··· 641 633 int *pins, int num_pins, void *data) 642 634 { 643 635 struct group_desc *group; 644 - int selector; 636 + int selector, error; 645 637 646 638 if (!name) 647 639 return -EINVAL; ··· 661 653 group->num_pins = num_pins; 662 654 group->data = data; 663 655 664 - radix_tree_insert(&pctldev->pin_group_tree, selector, group); 656 + error = radix_tree_insert(&pctldev->pin_group_tree, selector, group); 657 + if (error) 658 + return error; 665 659 666 660 pctldev->num_groups++; 667 661
+1 -1
drivers/pinctrl/freescale/pinctrl-imx.c
··· 14 14 #include <linux/module.h> 15 15 #include <linux/of.h> 16 16 #include <linux/of_address.h> 17 - #include <linux/of_device.h> 17 + #include <linux/platform_device.h> 18 18 #include <linux/regmap.h> 19 19 #include <linux/seq_file.h> 20 20 #include <linux/slab.h>
+2 -1
drivers/pinctrl/freescale/pinctrl-imx1-core.c
··· 15 15 #include <linux/init.h> 16 16 #include <linux/io.h> 17 17 #include <linux/of.h> 18 - #include <linux/of_device.h> 18 + #include <linux/of_platform.h> 19 + #include <linux/platform_device.h> 19 20 #include <linux/seq_file.h> 20 21 #include <linux/slab.h> 21 22
+2 -1
drivers/pinctrl/freescale/pinctrl-imx23.c
··· 6 6 // Copyright 2012 Freescale Semiconductor, Inc. 7 7 8 8 #include <linux/init.h> 9 - #include <linux/of_device.h> 9 + #include <linux/mod_devicetable.h> 10 + #include <linux/platform_device.h> 10 11 #include <linux/pinctrl/pinctrl.h> 11 12 #include "pinctrl-mxs.h" 12 13
+2 -2
drivers/pinctrl/freescale/pinctrl-imx25.c
··· 14 14 #include <linux/err.h> 15 15 #include <linux/init.h> 16 16 #include <linux/io.h> 17 - #include <linux/of.h> 18 - #include <linux/of_device.h> 17 + #include <linux/mod_devicetable.h> 18 + #include <linux/platform_device.h> 19 19 #include <linux/pinctrl/pinctrl.h> 20 20 21 21 #include "pinctrl-imx.h"
+2 -2
drivers/pinctrl/freescale/pinctrl-imx27.c
··· 9 9 #include <linux/err.h> 10 10 #include <linux/init.h> 11 11 #include <linux/io.h> 12 - #include <linux/of.h> 13 - #include <linux/of_device.h> 12 + #include <linux/mod_devicetable.h> 13 + #include <linux/platform_device.h> 14 14 #include <linux/pinctrl/pinctrl.h> 15 15 16 16 #include "pinctrl-imx1.h"
+2 -1
drivers/pinctrl/freescale/pinctrl-imx28.c
··· 6 6 // Copyright 2012 Freescale Semiconductor, Inc. 7 7 8 8 #include <linux/init.h> 9 - #include <linux/of_device.h> 9 + #include <linux/mod_devicetable.h> 10 + #include <linux/platform_device.h> 10 11 #include <linux/pinctrl/pinctrl.h> 11 12 #include "pinctrl-mxs.h" 12 13
+2 -2
drivers/pinctrl/freescale/pinctrl-imx35.c
··· 12 12 #include <linux/err.h> 13 13 #include <linux/init.h> 14 14 #include <linux/io.h> 15 - #include <linux/of.h> 16 - #include <linux/of_device.h> 15 + #include <linux/mod_devicetable.h> 16 + #include <linux/platform_device.h> 17 17 #include <linux/pinctrl/pinctrl.h> 18 18 19 19 #include "pinctrl-imx.h"
+2 -2
drivers/pinctrl/freescale/pinctrl-imx50.c
··· 9 9 #include <linux/err.h> 10 10 #include <linux/init.h> 11 11 #include <linux/io.h> 12 - #include <linux/of.h> 13 - #include <linux/of_device.h> 12 + #include <linux/mod_devicetable.h> 13 + #include <linux/platform_device.h> 14 14 #include <linux/pinctrl/pinctrl.h> 15 15 16 16 #include "pinctrl-imx.h"
+2 -2
drivers/pinctrl/freescale/pinctrl-imx51.c
··· 10 10 #include <linux/err.h> 11 11 #include <linux/init.h> 12 12 #include <linux/io.h> 13 - #include <linux/of.h> 14 - #include <linux/of_device.h> 13 + #include <linux/mod_devicetable.h> 14 + #include <linux/platform_device.h> 15 15 #include <linux/pinctrl/pinctrl.h> 16 16 17 17 #include "pinctrl-imx.h"
+2 -2
drivers/pinctrl/freescale/pinctrl-imx53.c
··· 10 10 #include <linux/err.h> 11 11 #include <linux/init.h> 12 12 #include <linux/io.h> 13 - #include <linux/of.h> 14 - #include <linux/of_device.h> 13 + #include <linux/mod_devicetable.h> 14 + #include <linux/platform_device.h> 15 15 #include <linux/pinctrl/pinctrl.h> 16 16 17 17 #include "pinctrl-imx.h"
+2 -2
drivers/pinctrl/freescale/pinctrl-imx6dl.c
··· 8 8 #include <linux/err.h> 9 9 #include <linux/init.h> 10 10 #include <linux/io.h> 11 - #include <linux/of.h> 12 - #include <linux/of_device.h> 11 + #include <linux/mod_devicetable.h> 12 + #include <linux/platform_device.h> 13 13 #include <linux/pinctrl/pinctrl.h> 14 14 15 15 #include "pinctrl-imx.h"
+2 -2
drivers/pinctrl/freescale/pinctrl-imx6q.c
··· 10 10 #include <linux/err.h> 11 11 #include <linux/init.h> 12 12 #include <linux/io.h> 13 - #include <linux/of.h> 14 - #include <linux/of_device.h> 13 + #include <linux/mod_devicetable.h> 14 + #include <linux/platform_device.h> 15 15 #include <linux/pinctrl/pinctrl.h> 16 16 17 17 #include "pinctrl-imx.h"
+2 -2
drivers/pinctrl/freescale/pinctrl-imx6sl.c
··· 8 8 #include <linux/err.h> 9 9 #include <linux/init.h> 10 10 #include <linux/io.h> 11 - #include <linux/of.h> 12 - #include <linux/of_device.h> 11 + #include <linux/mod_devicetable.h> 12 + #include <linux/platform_device.h> 13 13 #include <linux/pinctrl/pinctrl.h> 14 14 15 15 #include "pinctrl-imx.h"
+2 -2
drivers/pinctrl/freescale/pinctrl-imx6sll.c
··· 7 7 #include <linux/init.h> 8 8 #include <linux/io.h> 9 9 #include <linux/module.h> 10 - #include <linux/of.h> 11 - #include <linux/of_device.h> 10 + #include <linux/mod_devicetable.h> 11 + #include <linux/platform_device.h> 12 12 #include <linux/pinctrl/pinctrl.h> 13 13 14 14 #include "pinctrl-imx.h"
+2 -2
drivers/pinctrl/freescale/pinctrl-imx6sx.c
··· 8 8 #include <linux/err.h> 9 9 #include <linux/init.h> 10 10 #include <linux/io.h> 11 - #include <linux/of.h> 12 - #include <linux/of_device.h> 11 + #include <linux/mod_devicetable.h> 12 + #include <linux/platform_device.h> 13 13 #include <linux/pinctrl/pinctrl.h> 14 14 15 15 #include "pinctrl-imx.h"
+1 -1
drivers/pinctrl/freescale/pinctrl-imx6ul.c
··· 9 9 #include <linux/init.h> 10 10 #include <linux/io.h> 11 11 #include <linux/of.h> 12 - #include <linux/of_device.h> 12 + #include <linux/platform_device.h> 13 13 #include <linux/pinctrl/pinctrl.h> 14 14 15 15 #include "pinctrl-imx.h"
+1 -1
drivers/pinctrl/freescale/pinctrl-imx7d.c
··· 9 9 #include <linux/init.h> 10 10 #include <linux/io.h> 11 11 #include <linux/of.h> 12 - #include <linux/of_device.h> 12 + #include <linux/platform_device.h> 13 13 #include <linux/pinctrl/pinctrl.h> 14 14 15 15 #include "pinctrl-imx.h"
+2 -3
drivers/pinctrl/freescale/pinctrl-imx7ulp.c
··· 8 8 #include <linux/err.h> 9 9 #include <linux/init.h> 10 10 #include <linux/io.h> 11 - #include <linux/module.h> 12 - #include <linux/of.h> 13 - #include <linux/of_device.h> 11 + #include <linux/mod_devicetable.h> 12 + #include <linux/platform_device.h> 14 13 #include <linux/pinctrl/pinctrl.h> 15 14 16 15 #include "pinctrl-imx.h"
+2 -2
drivers/pinctrl/freescale/pinctrl-imx8dxl.c
··· 8 8 #include <linux/firmware/imx/sci.h> 9 9 #include <linux/init.h> 10 10 #include <linux/io.h> 11 + #include <linux/mod_devicetable.h> 11 12 #include <linux/module.h> 12 - #include <linux/of.h> 13 - #include <linux/of_device.h> 14 13 #include <linux/pinctrl/pinctrl.h> 14 + #include <linux/platform_device.h> 15 15 16 16 #include "pinctrl-imx.h" 17 17
+1 -1
drivers/pinctrl/freescale/pinctrl-imx8mm.c
··· 6 6 #include <linux/err.h> 7 7 #include <linux/init.h> 8 8 #include <linux/module.h> 9 - #include <linux/of_device.h> 9 + #include <linux/of.h> 10 10 #include <linux/pinctrl/pinctrl.h> 11 11 #include <linux/platform_device.h> 12 12
+2 -2
drivers/pinctrl/freescale/pinctrl-imx8mq.c
··· 8 8 #include <linux/err.h> 9 9 #include <linux/init.h> 10 10 #include <linux/io.h> 11 + #include <linux/mod_devicetable.h> 11 12 #include <linux/module.h> 12 - #include <linux/of.h> 13 - #include <linux/of_device.h> 14 13 #include <linux/pinctrl/pinctrl.h> 14 + #include <linux/platform_device.h> 15 15 16 16 #include "pinctrl-imx.h" 17 17
+2 -1
drivers/pinctrl/freescale/pinctrl-imx8qxp.c
··· 10 10 #include <linux/firmware/imx/sci.h> 11 11 #include <linux/init.h> 12 12 #include <linux/io.h> 13 + #include <linux/mod_devicetable.h> 13 14 #include <linux/module.h> 14 15 #include <linux/of.h> 15 - #include <linux/of_device.h> 16 16 #include <linux/pinctrl/pinctrl.h> 17 + #include <linux/platform_device.h> 17 18 18 19 #include "pinctrl-imx.h" 19 20
+2 -2
drivers/pinctrl/freescale/pinctrl-imx8ulp.c
··· 6 6 #include <linux/err.h> 7 7 #include <linux/init.h> 8 8 #include <linux/io.h> 9 + #include <linux/mod_devicetable.h> 9 10 #include <linux/module.h> 10 - #include <linux/of.h> 11 - #include <linux/of_device.h> 12 11 #include <linux/pinctrl/pinctrl.h> 12 + #include <linux/platform_device.h> 13 13 14 14 #include "pinctrl-imx.h" 15 15
+2 -2
drivers/pinctrl/freescale/pinctrl-imx93.c
··· 6 6 #include <linux/err.h> 7 7 #include <linux/init.h> 8 8 #include <linux/io.h> 9 + #include <linux/mod_devicetable.h> 9 10 #include <linux/module.h> 10 - #include <linux/of.h> 11 - #include <linux/of_device.h> 12 11 #include <linux/pinctrl/pinctrl.h> 12 + #include <linux/platform_device.h> 13 13 14 14 #include "pinctrl-imx.h" 15 15
+1 -1
drivers/pinctrl/freescale/pinctrl-imxrt1050.c
··· 6 6 7 7 #include <linux/err.h> 8 8 #include <linux/init.h> 9 - #include <linux/of_device.h> 9 + #include <linux/of.h> 10 10 #include <linux/pinctrl/pinctrl.h> 11 11 #include <linux/platform_device.h> 12 12
+1 -1
drivers/pinctrl/freescale/pinctrl-imxrt1170.c
··· 6 6 7 7 #include <linux/err.h> 8 8 #include <linux/init.h> 9 - #include <linux/of_device.h> 9 + #include <linux/of.h> 10 10 #include <linux/pinctrl/pinctrl.h> 11 11 #include <linux/platform_device.h> 12 12
+2 -2
drivers/pinctrl/freescale/pinctrl-vf610.c
··· 7 7 #include <linux/err.h> 8 8 #include <linux/init.h> 9 9 #include <linux/io.h> 10 - #include <linux/of.h> 11 - #include <linux/of_device.h> 10 + #include <linux/mod_devicetable.h> 11 + #include <linux/platform_device.h> 12 12 #include <linux/pinctrl/pinctrl.h> 13 13 14 14 #include "pinctrl-imx.h"
+3 -46
drivers/pinctrl/intel/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # Intel pin control drivers 3 3 menu "Intel pinctrl drivers" 4 - depends on X86 || COMPILE_TEST 4 + depends on ACPI && (X86 || COMPILE_TEST) 5 5 6 6 config PINCTRL_BAYTRAIL 7 7 bool "Intel Baytrail GPIO pin control" 8 - depends on ACPI 9 8 select PINCTRL_INTEL 10 9 help 11 10 driver for memory mapped GPIO functionality on Intel Baytrail ··· 16 17 17 18 config PINCTRL_CHERRYVIEW 18 19 tristate "Intel Cherryview/Braswell pinctrl and GPIO driver" 19 - depends on ACPI 20 20 select PINCTRL_INTEL 21 21 help 22 22 Cherryview/Braswell pinctrl driver provides an interface that ··· 23 25 24 26 config PINCTRL_LYNXPOINT 25 27 tristate "Intel Lynxpoint pinctrl and GPIO driver" 26 - depends on ACPI 27 - select PINMUX 28 - select PINCONF 29 - select GENERIC_PINCONF 30 - select GPIOLIB 31 - select GPIOLIB_IRQCHIP 28 + select PINCTRL_INTEL 32 29 help 33 30 Lynxpoint is the PCH of Intel Haswell. This pinctrl driver 34 31 provides an interface that allows configuring of PCH pins and 35 32 using them as GPIOs. 36 - 37 - config PINCTRL_MERRIFIELD 38 - tristate "Intel Merrifield pinctrl driver" 39 - depends on X86_INTEL_MID 40 - select PINMUX 41 - select PINCONF 42 - select GENERIC_PINCONF 43 - help 44 - Merrifield Family-Level Interface Shim (FLIS) driver provides an 45 - interface that allows configuring of SoC pins and using them as 46 - GPIOs. 47 - 48 - config PINCTRL_MOOREFIELD 49 - tristate "Intel Moorefield pinctrl driver" 50 - depends on X86_INTEL_MID 51 - select PINMUX 52 - select PINCONF 53 - select GENERIC_PINCONF 54 - help 55 - Moorefield Family-Level Interface Shim (FLIS) driver provides an 56 - interface that allows configuring of SoC pins and using them as 57 - GPIOs. 58 33 59 34 config PINCTRL_INTEL 60 35 tristate ··· 39 68 40 69 config PINCTRL_ALDERLAKE 41 70 tristate "Intel Alder Lake pinctrl and GPIO driver" 42 - depends on ACPI 43 71 select PINCTRL_INTEL 44 72 help 45 73 This pinctrl driver provides an interface that allows configuring ··· 46 76 47 77 config PINCTRL_BROXTON 48 78 tristate "Intel Broxton pinctrl and GPIO driver" 49 - depends on ACPI 50 79 select PINCTRL_INTEL 51 80 help 52 81 Broxton pinctrl driver provides an interface that allows ··· 53 84 54 85 config PINCTRL_CANNONLAKE 55 86 tristate "Intel Cannon Lake PCH pinctrl and GPIO driver" 56 - depends on ACPI 57 87 select PINCTRL_INTEL 58 88 help 59 89 This pinctrl driver provides an interface that allows configuring ··· 60 92 61 93 config PINCTRL_CEDARFORK 62 94 tristate "Intel Cedar Fork pinctrl and GPIO driver" 63 - depends on ACPI 64 95 select PINCTRL_INTEL 65 96 help 66 97 This pinctrl driver provides an interface that allows configuring ··· 67 100 68 101 config PINCTRL_DENVERTON 69 102 tristate "Intel Denverton pinctrl and GPIO driver" 70 - depends on ACPI 71 103 select PINCTRL_INTEL 72 104 help 73 105 This pinctrl driver provides an interface that allows configuring ··· 74 108 75 109 config PINCTRL_ELKHARTLAKE 76 110 tristate "Intel Elkhart Lake SoC pinctrl and GPIO driver" 77 - depends on ACPI 78 111 select PINCTRL_INTEL 79 112 help 80 113 This pinctrl driver provides an interface that allows configuring ··· 81 116 82 117 config PINCTRL_EMMITSBURG 83 118 tristate "Intel Emmitsburg pinctrl and GPIO driver" 84 - depends on ACPI 85 119 select PINCTRL_INTEL 86 120 help 87 121 This pinctrl driver provides an interface that allows configuring ··· 88 124 89 125 config PINCTRL_GEMINILAKE 90 126 tristate "Intel Gemini Lake SoC pinctrl and GPIO driver" 91 - depends on ACPI 92 127 select PINCTRL_INTEL 93 128 help 94 129 This pinctrl driver provides an interface that allows configuring ··· 95 132 96 133 config PINCTRL_ICELAKE 97 134 tristate "Intel Ice Lake PCH pinctrl and GPIO driver" 98 - depends on ACPI 99 135 select PINCTRL_INTEL 100 136 help 101 137 This pinctrl driver provides an interface that allows configuring ··· 102 140 103 141 config PINCTRL_JASPERLAKE 104 142 tristate "Intel Jasper Lake PCH pinctrl and GPIO driver" 105 - depends on ACPI 106 143 select PINCTRL_INTEL 107 144 help 108 145 This pinctrl driver provides an interface that allows configuring ··· 109 148 110 149 config PINCTRL_LAKEFIELD 111 150 tristate "Intel Lakefield SoC pinctrl and GPIO driver" 112 - depends on ACPI 113 151 select PINCTRL_INTEL 114 152 help 115 153 This pinctrl driver provides an interface that allows configuring ··· 116 156 117 157 config PINCTRL_LEWISBURG 118 158 tristate "Intel Lewisburg pinctrl and GPIO driver" 119 - depends on ACPI 120 159 select PINCTRL_INTEL 121 160 help 122 161 This pinctrl driver provides an interface that allows configuring ··· 123 164 124 165 config PINCTRL_METEORLAKE 125 166 tristate "Intel Meteor Lake pinctrl and GPIO driver" 126 - depends on ACPI 127 167 select PINCTRL_INTEL 128 168 help 129 169 This pinctrl driver provides an interface that allows configuring ··· 130 172 131 173 config PINCTRL_SUNRISEPOINT 132 174 tristate "Intel Sunrisepoint pinctrl and GPIO driver" 133 - depends on ACPI 134 175 select PINCTRL_INTEL 135 176 help 136 177 Sunrisepoint is the PCH of Intel Skylake. This pinctrl driver ··· 138 181 139 182 config PINCTRL_TIGERLAKE 140 183 tristate "Intel Tiger Lake pinctrl and GPIO driver" 141 - depends on ACPI 142 184 select PINCTRL_INTEL 143 185 help 144 186 This pinctrl driver provides an interface that allows configuring 145 187 of Intel Tiger Lake PCH pins and using them as GPIOs. 146 188 189 + source "drivers/pinctrl/intel/Kconfig.tng" 147 190 endmenu
+33
drivers/pinctrl/intel/Kconfig.tng
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + # Intel Tangier and compatible pin control drivers 3 + 4 + if X86_INTEL_MID || COMPILE_TEST 5 + 6 + config PINCTRL_TANGIER 7 + tristate 8 + select PINMUX 9 + select PINCONF 10 + select GENERIC_PINCONF 11 + help 12 + This is a library driver for Intel Tangier pin controller and to 13 + be selected and used by respective compatible platform drivers. 14 + 15 + If built as a module its name will be pinctrl-tangier. 16 + 17 + config PINCTRL_MERRIFIELD 18 + tristate "Intel Merrifield pinctrl driver" 19 + select PINCTRL_TANGIER 20 + help 21 + Intel Merrifield Family-Level Interface Shim (FLIS) driver provides 22 + an interface that allows configuring of SoC pins and using them as 23 + GPIOs. 24 + 25 + config PINCTRL_MOOREFIELD 26 + tristate "Intel Moorefield pinctrl driver" 27 + select PINCTRL_TANGIER 28 + help 29 + Intel Moorefield Family-Level Interface Shim (FLIS) driver provides 30 + an interface that allows configuring of SoC pins and using them as 31 + GPIOs. 32 + 33 + endif
+1
drivers/pinctrl/intel/Makefile
··· 4 4 obj-$(CONFIG_PINCTRL_BAYTRAIL) += pinctrl-baytrail.o 5 5 obj-$(CONFIG_PINCTRL_CHERRYVIEW) += pinctrl-cherryview.o 6 6 obj-$(CONFIG_PINCTRL_LYNXPOINT) += pinctrl-lynxpoint.o 7 + obj-$(CONFIG_PINCTRL_TANGIER) += pinctrl-tangier.o 7 8 obj-$(CONFIG_PINCTRL_MERRIFIELD) += pinctrl-merrifield.o 8 9 obj-$(CONFIG_PINCTRL_MOOREFIELD) += pinctrl-moorefield.o 9 10 obj-$(CONFIG_PINCTRL_INTEL) += pinctrl-intel.o
+1
drivers/pinctrl/intel/pinctrl-alderlake.c
··· 748 748 MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>"); 749 749 MODULE_DESCRIPTION("Intel Alder Lake PCH pinctrl/GPIO driver"); 750 750 MODULE_LICENSE("GPL v2"); 751 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+29 -106
drivers/pinctrl/intel/pinctrl-baytrail.c
··· 13 13 #include <linux/interrupt.h> 14 14 #include <linux/io.h> 15 15 #include <linux/kernel.h> 16 + #include <linux/module.h> 16 17 #include <linux/types.h> 17 18 #include <linux/platform_device.h> 18 19 #include <linux/pm_runtime.h> ··· 552 551 553 552 static DEFINE_RAW_SPINLOCK(byt_lock); 554 553 555 - static struct intel_community *byt_get_community(struct intel_pinctrl *vg, 556 - unsigned int pin) 557 - { 558 - struct intel_community *comm; 559 - int i; 560 - 561 - for (i = 0; i < vg->ncommunities; i++) { 562 - comm = vg->communities + i; 563 - if (pin < comm->pin_base + comm->npins && pin >= comm->pin_base) 564 - return comm; 565 - } 566 - 567 - return NULL; 568 - } 569 - 570 554 static void __iomem *byt_gpio_reg(struct intel_pinctrl *vg, unsigned int offset, 571 555 int reg) 572 556 { 573 - struct intel_community *comm = byt_get_community(vg, offset); 557 + struct intel_community *comm = intel_get_community(vg, offset); 574 558 u32 reg_offset; 575 559 576 560 if (!comm) ··· 577 591 return comm->pad_regs + reg_offset + reg; 578 592 } 579 593 580 - static int byt_get_groups_count(struct pinctrl_dev *pctldev) 581 - { 582 - struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 583 - 584 - return vg->soc->ngroups; 585 - } 586 - 587 - static const char *byt_get_group_name(struct pinctrl_dev *pctldev, 588 - unsigned int selector) 589 - { 590 - struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 591 - 592 - return vg->soc->groups[selector].grp.name; 593 - } 594 - 595 - static int byt_get_group_pins(struct pinctrl_dev *pctldev, 596 - unsigned int selector, 597 - const unsigned int **pins, 598 - unsigned int *num_pins) 599 - { 600 - struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 601 - 602 - *pins = vg->soc->groups[selector].grp.pins; 603 - *num_pins = vg->soc->groups[selector].grp.npins; 604 - 605 - return 0; 606 - } 607 - 608 594 static const struct pinctrl_ops byt_pinctrl_ops = { 609 - .get_groups_count = byt_get_groups_count, 610 - .get_group_name = byt_get_group_name, 611 - .get_group_pins = byt_get_group_pins, 595 + .get_groups_count = intel_get_groups_count, 596 + .get_group_name = intel_get_group_name, 597 + .get_group_pins = intel_get_group_pins, 612 598 }; 613 - 614 - static int byt_get_functions_count(struct pinctrl_dev *pctldev) 615 - { 616 - struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 617 - 618 - return vg->soc->nfunctions; 619 - } 620 - 621 - static const char *byt_get_function_name(struct pinctrl_dev *pctldev, 622 - unsigned int selector) 623 - { 624 - struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 625 - 626 - return vg->soc->functions[selector].func.name; 627 - } 628 - 629 - static int byt_get_function_groups(struct pinctrl_dev *pctldev, 630 - unsigned int selector, 631 - const char * const **groups, 632 - unsigned int *ngroups) 633 - { 634 - struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 635 - 636 - *groups = vg->soc->functions[selector].func.groups; 637 - *ngroups = vg->soc->functions[selector].func.ngroups; 638 - 639 - return 0; 640 - } 641 599 642 600 static void byt_set_group_simple_mux(struct intel_pinctrl *vg, 643 601 const struct intel_pingroup group, ··· 781 851 } 782 852 783 853 static const struct pinmux_ops byt_pinmux_ops = { 784 - .get_functions_count = byt_get_functions_count, 785 - .get_function_name = byt_get_function_name, 786 - .get_function_groups = byt_get_function_groups, 854 + .get_functions_count = intel_get_functions_count, 855 + .get_function_name = intel_get_function_name, 856 + .get_function_groups = intel_get_function_groups, 787 857 .set_mux = byt_set_mux, 788 858 .gpio_request_enable = byt_gpio_request_enable, 789 859 .gpio_disable_free = byt_gpio_disable_free, ··· 925 995 void __iomem *conf_reg = byt_gpio_reg(vg, offset, BYT_CONF0_REG); 926 996 void __iomem *val_reg = byt_gpio_reg(vg, offset, BYT_VAL_REG); 927 997 void __iomem *db_reg = byt_gpio_reg(vg, offset, BYT_DEBOUNCE_REG); 998 + u32 conf, val, db_pulse, debounce; 928 999 unsigned long flags; 929 - u32 conf, val, debounce; 930 1000 int i, ret = 0; 931 1001 932 1002 raw_spin_lock_irqsave(&byt_lock, flags); ··· 983 1053 984 1054 break; 985 1055 case PIN_CONFIG_INPUT_DEBOUNCE: 986 - debounce = readl(db_reg); 987 - 988 1056 if (arg) 989 1057 conf |= BYT_DEBOUNCE_EN; 990 1058 else ··· 990 1062 991 1063 switch (arg) { 992 1064 case 375: 993 - debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 994 - debounce |= BYT_DEBOUNCE_PULSE_375US; 1065 + db_pulse = BYT_DEBOUNCE_PULSE_375US; 995 1066 break; 996 1067 case 750: 997 - debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 998 - debounce |= BYT_DEBOUNCE_PULSE_750US; 1068 + db_pulse = BYT_DEBOUNCE_PULSE_750US; 999 1069 break; 1000 1070 case 1500: 1001 - debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1002 - debounce |= BYT_DEBOUNCE_PULSE_1500US; 1071 + db_pulse = BYT_DEBOUNCE_PULSE_1500US; 1003 1072 break; 1004 1073 case 3000: 1005 - debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1006 - debounce |= BYT_DEBOUNCE_PULSE_3MS; 1074 + db_pulse = BYT_DEBOUNCE_PULSE_3MS; 1007 1075 break; 1008 1076 case 6000: 1009 - debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1010 - debounce |= BYT_DEBOUNCE_PULSE_6MS; 1077 + db_pulse = BYT_DEBOUNCE_PULSE_6MS; 1011 1078 break; 1012 1079 case 12000: 1013 - debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1014 - debounce |= BYT_DEBOUNCE_PULSE_12MS; 1080 + db_pulse = BYT_DEBOUNCE_PULSE_12MS; 1015 1081 break; 1016 1082 case 24000: 1017 - debounce &= ~BYT_DEBOUNCE_PULSE_MASK; 1018 - debounce |= BYT_DEBOUNCE_PULSE_24MS; 1083 + db_pulse = BYT_DEBOUNCE_PULSE_24MS; 1019 1084 break; 1020 1085 default: 1021 1086 if (arg) ··· 1016 1095 break; 1017 1096 } 1018 1097 1019 - if (!ret) 1020 - writel(debounce, db_reg); 1098 + if (ret) 1099 + break; 1100 + 1101 + debounce = readl(db_reg); 1102 + debounce = (debounce & ~BYT_DEBOUNCE_PULSE_MASK) | db_pulse; 1103 + writel(debounce, db_reg); 1104 + 1021 1105 break; 1022 1106 default: 1023 1107 ret = -ENOTSUPP; ··· 1191 1265 val = readl(val_reg); 1192 1266 raw_spin_unlock_irqrestore(&byt_lock, flags); 1193 1267 1194 - comm = byt_get_community(vg, pin); 1268 + comm = intel_get_community(vg, pin); 1195 1269 if (!comm) { 1196 1270 seq_printf(s, "Pin %i: can't retrieve community\n", pin); 1197 1271 continue; ··· 1659 1733 return 0; 1660 1734 } 1661 1735 1662 - #ifdef CONFIG_PM_SLEEP 1663 1736 static int byt_gpio_suspend(struct device *dev) 1664 1737 { 1665 1738 struct intel_pinctrl *vg = dev_get_drvdata(dev); ··· 1742 1817 raw_spin_unlock_irqrestore(&byt_lock, flags); 1743 1818 return 0; 1744 1819 } 1745 - #endif 1746 1820 1747 - #ifdef CONFIG_PM 1748 1821 static int byt_gpio_runtime_suspend(struct device *dev) 1749 1822 { 1750 1823 return 0; ··· 1752 1829 { 1753 1830 return 0; 1754 1831 } 1755 - #endif 1756 1832 1757 1833 static const struct dev_pm_ops byt_gpio_pm_ops = { 1758 - SET_LATE_SYSTEM_SLEEP_PM_OPS(byt_gpio_suspend, byt_gpio_resume) 1759 - SET_RUNTIME_PM_OPS(byt_gpio_runtime_suspend, byt_gpio_runtime_resume, 1760 - NULL) 1834 + LATE_SYSTEM_SLEEP_PM_OPS(byt_gpio_suspend, byt_gpio_resume) 1835 + RUNTIME_PM_OPS(byt_gpio_runtime_suspend, byt_gpio_runtime_resume, NULL) 1761 1836 }; 1762 1837 1763 1838 static struct platform_driver byt_gpio_driver = { 1764 1839 .probe = byt_pinctrl_probe, 1765 1840 .driver = { 1766 1841 .name = "byt_gpio", 1767 - .pm = &byt_gpio_pm_ops, 1842 + .pm = pm_ptr(&byt_gpio_pm_ops), 1768 1843 .acpi_match_table = byt_gpio_acpi_match, 1769 1844 .suppress_bind_attrs = true, 1770 1845 }, ··· 1773 1852 return platform_driver_register(&byt_gpio_driver); 1774 1853 } 1775 1854 subsys_initcall(byt_gpio_init); 1855 + 1856 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+1
drivers/pinctrl/intel/pinctrl-broxton.c
··· 1028 1028 MODULE_LICENSE("GPL v2"); 1029 1029 MODULE_ALIAS("platform:apollolake-pinctrl"); 1030 1030 MODULE_ALIAS("platform:broxton-pinctrl"); 1031 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+1 -1
drivers/pinctrl/intel/pinctrl-cannonlake.c
··· 834 834 .pm = &cnl_pinctrl_pm_ops, 835 835 }, 836 836 }; 837 - 838 837 module_platform_driver(cnl_pinctrl_driver); 839 838 840 839 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); 841 840 MODULE_DESCRIPTION("Intel Cannon Lake PCH pinctrl/GPIO driver"); 842 841 MODULE_LICENSE("GPL v2"); 842 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+1
drivers/pinctrl/intel/pinctrl-cedarfork.c
··· 351 351 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); 352 352 MODULE_DESCRIPTION("Intel Cedar Fork PCH pinctrl/GPIO driver"); 353 353 MODULE_LICENSE("GPL v2"); 354 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+14 -70
drivers/pinctrl/intel/pinctrl-cherryview.c
··· 617 617 return chv_readl(pctrl, offset, CHV_PADCTRL1) & CHV_PADCTRL1_CFGLOCK; 618 618 } 619 619 620 - static int chv_get_groups_count(struct pinctrl_dev *pctldev) 621 - { 622 - struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 623 - 624 - return pctrl->soc->ngroups; 625 - } 626 - 627 - static const char *chv_get_group_name(struct pinctrl_dev *pctldev, 628 - unsigned int group) 629 - { 630 - struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 631 - 632 - return pctrl->soc->groups[group].grp.name; 633 - } 634 - 635 - static int chv_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, 636 - const unsigned int **pins, unsigned int *npins) 637 - { 638 - struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 639 - 640 - *pins = pctrl->soc->groups[group].grp.pins; 641 - *npins = pctrl->soc->groups[group].grp.npins; 642 - return 0; 643 - } 644 - 645 620 static void chv_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, 646 621 unsigned int offset) 647 622 { ··· 651 676 } 652 677 653 678 static const struct pinctrl_ops chv_pinctrl_ops = { 654 - .get_groups_count = chv_get_groups_count, 655 - .get_group_name = chv_get_group_name, 656 - .get_group_pins = chv_get_group_pins, 679 + .get_groups_count = intel_get_groups_count, 680 + .get_group_name = intel_get_group_name, 681 + .get_group_pins = intel_get_group_pins, 657 682 .pin_dbg_show = chv_pin_dbg_show, 658 683 }; 659 - 660 - static int chv_get_functions_count(struct pinctrl_dev *pctldev) 661 - { 662 - struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 663 - 664 - return pctrl->soc->nfunctions; 665 - } 666 - 667 - static const char *chv_get_function_name(struct pinctrl_dev *pctldev, 668 - unsigned int function) 669 - { 670 - struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 671 - 672 - return pctrl->soc->functions[function].func.name; 673 - } 674 - 675 - static int chv_get_function_groups(struct pinctrl_dev *pctldev, 676 - unsigned int function, 677 - const char * const **groups, 678 - unsigned int * const ngroups) 679 - { 680 - struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 681 - 682 - *groups = pctrl->soc->functions[function].func.groups; 683 - *ngroups = pctrl->soc->functions[function].func.ngroups; 684 - return 0; 685 - } 686 684 687 685 static int chv_pinmux_set_mux(struct pinctrl_dev *pctldev, 688 686 unsigned int function, unsigned int group) ··· 832 884 } 833 885 834 886 static const struct pinmux_ops chv_pinmux_ops = { 835 - .get_functions_count = chv_get_functions_count, 836 - .get_function_name = chv_get_function_name, 837 - .get_function_groups = chv_get_function_groups, 887 + .get_functions_count = intel_get_functions_count, 888 + .get_function_name = intel_get_function_name, 889 + .get_function_groups = intel_get_function_groups, 838 890 .set_mux = chv_pinmux_set_mux, 839 891 .gpio_request_enable = chv_gpio_request_enable, 840 892 .gpio_disable_free = chv_gpio_disable_free, ··· 1066 1118 unsigned int npins; 1067 1119 int ret; 1068 1120 1069 - ret = chv_get_group_pins(pctldev, group, &pins, &npins); 1121 + ret = intel_get_group_pins(pctldev, group, &pins, &npins); 1070 1122 if (ret) 1071 1123 return ret; 1072 1124 ··· 1085 1137 unsigned int npins; 1086 1138 int i, ret; 1087 1139 1088 - ret = chv_get_group_pins(pctldev, group, &pins, &npins); 1140 + ret = intel_get_group_pins(pctldev, group, &pins, &npins); 1089 1141 if (ret) 1090 1142 return ret; 1091 1143 ··· 1649 1701 struct intel_community_context *cctx; 1650 1702 struct intel_community *community; 1651 1703 struct device *dev = &pdev->dev; 1652 - struct acpi_device *adev = ACPI_COMPANION(dev); 1653 1704 struct intel_pinctrl *pctrl; 1654 1705 acpi_status status; 1655 1706 unsigned int i; ··· 1716 1769 if (ret) 1717 1770 return ret; 1718 1771 1719 - status = acpi_install_address_space_handler(adev->handle, 1772 + status = acpi_install_address_space_handler(ACPI_HANDLE(dev), 1720 1773 community->acpi_space_id, 1721 1774 chv_pinctrl_mmio_access_handler, 1722 1775 NULL, pctrl); ··· 1733 1786 struct intel_pinctrl *pctrl = platform_get_drvdata(pdev); 1734 1787 const struct intel_community *community = &pctrl->communities[0]; 1735 1788 1736 - acpi_remove_address_space_handler(ACPI_COMPANION(&pdev->dev), 1789 + acpi_remove_address_space_handler(ACPI_HANDLE(&pdev->dev), 1737 1790 community->acpi_space_id, 1738 1791 chv_pinctrl_mmio_access_handler); 1739 1792 1740 1793 return 0; 1741 1794 } 1742 1795 1743 - #ifdef CONFIG_PM_SLEEP 1744 1796 static int chv_pinctrl_suspend_noirq(struct device *dev) 1745 1797 { 1746 1798 struct intel_pinctrl *pctrl = dev_get_drvdata(dev); ··· 1823 1877 1824 1878 return 0; 1825 1879 } 1826 - #endif 1827 1880 1828 - static const struct dev_pm_ops chv_pinctrl_pm_ops = { 1829 - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(chv_pinctrl_suspend_noirq, 1830 - chv_pinctrl_resume_noirq) 1831 - }; 1881 + static DEFINE_NOIRQ_DEV_PM_OPS(chv_pinctrl_pm_ops, 1882 + chv_pinctrl_suspend_noirq, chv_pinctrl_resume_noirq); 1832 1883 1833 1884 static const struct acpi_device_id chv_pinctrl_acpi_match[] = { 1834 1885 { "INT33FF", (kernel_ulong_t)chv_soc_data }, ··· 1838 1895 .remove = chv_pinctrl_remove, 1839 1896 .driver = { 1840 1897 .name = "cherryview-pinctrl", 1841 - .pm = &chv_pinctrl_pm_ops, 1898 + .pm = pm_sleep_ptr(&chv_pinctrl_pm_ops), 1842 1899 .acpi_match_table = chv_pinctrl_acpi_match, 1843 1900 }, 1844 1901 }; ··· 1858 1915 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); 1859 1916 MODULE_DESCRIPTION("Intel Cherryview/Braswell pinctrl driver"); 1860 1917 MODULE_LICENSE("GPL v2"); 1918 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+1
drivers/pinctrl/intel/pinctrl-denverton.c
··· 281 281 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); 282 282 MODULE_DESCRIPTION("Intel Denverton SoC pinctrl/GPIO driver"); 283 283 MODULE_LICENSE("GPL v2"); 284 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+1 -1
drivers/pinctrl/intel/pinctrl-elkhartlake.c
··· 495 495 .pm = &ehl_pinctrl_pm_ops, 496 496 }, 497 497 }; 498 - 499 498 module_platform_driver(ehl_pinctrl_driver); 500 499 501 500 MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>"); 502 501 MODULE_DESCRIPTION("Intel Elkhart Lake PCH pinctrl/GPIO driver"); 503 502 MODULE_LICENSE("GPL v2"); 503 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+1 -1
drivers/pinctrl/intel/pinctrl-emmitsburg.c
··· 368 368 .pm = &ebg_pinctrl_pm_ops, 369 369 }, 370 370 }; 371 - 372 371 module_platform_driver(ebg_pinctrl_driver); 373 372 374 373 MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>"); 375 374 MODULE_DESCRIPTION("Intel Emmitsburg PCH pinctrl/GPIO driver"); 376 375 MODULE_LICENSE("GPL v2"); 376 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+1
drivers/pinctrl/intel/pinctrl-geminilake.c
··· 473 473 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); 474 474 MODULE_DESCRIPTION("Intel Gemini Lake SoC pinctrl/GPIO driver"); 475 475 MODULE_LICENSE("GPL v2"); 476 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+1 -1
drivers/pinctrl/intel/pinctrl-icelake.c
··· 685 685 .pm = &icl_pinctrl_pm_ops, 686 686 }, 687 687 }; 688 - 689 688 module_platform_driver(icl_pinctrl_driver); 690 689 691 690 MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>"); 692 691 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); 693 692 MODULE_DESCRIPTION("Intel Ice Lake PCH pinctrl/GPIO driver"); 694 693 MODULE_LICENSE("GPL v2"); 694 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+19 -17
drivers/pinctrl/intel/pinctrl-intel.c
··· 107 107 #define pin_to_padno(c, p) ((p) - (c)->pin_base) 108 108 #define padgroup_offset(g, p) ((p) - (g)->base) 109 109 110 - static struct intel_community *intel_get_community(struct intel_pinctrl *pctrl, 111 - unsigned int pin) 110 + struct intel_community *intel_get_community(struct intel_pinctrl *pctrl, unsigned int pin) 112 111 { 113 112 struct intel_community *community; 114 113 int i; ··· 122 123 dev_warn(pctrl->dev, "failed to find community for pin %u\n", pin); 123 124 return NULL; 124 125 } 126 + EXPORT_SYMBOL_NS_GPL(intel_get_community, PINCTRL_INTEL); 125 127 126 128 static const struct intel_padgroup * 127 129 intel_community_get_padgroup(const struct intel_community *community, ··· 276 276 return intel_pad_owned_by_host(pctrl, pin) && intel_pad_is_unlocked(pctrl, pin); 277 277 } 278 278 279 - static int intel_get_groups_count(struct pinctrl_dev *pctldev) 279 + int intel_get_groups_count(struct pinctrl_dev *pctldev) 280 280 { 281 281 struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 282 282 283 283 return pctrl->soc->ngroups; 284 284 } 285 + EXPORT_SYMBOL_NS_GPL(intel_get_groups_count, PINCTRL_INTEL); 285 286 286 - static const char *intel_get_group_name(struct pinctrl_dev *pctldev, 287 - unsigned int group) 287 + const char *intel_get_group_name(struct pinctrl_dev *pctldev, unsigned int group) 288 288 { 289 289 struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 290 290 291 291 return pctrl->soc->groups[group].grp.name; 292 292 } 293 + EXPORT_SYMBOL_NS_GPL(intel_get_group_name, PINCTRL_INTEL); 293 294 294 - static int intel_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, 295 - const unsigned int **pins, unsigned int *npins) 295 + int intel_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, 296 + const unsigned int **pins, unsigned int *npins) 296 297 { 297 298 struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 298 299 ··· 301 300 *npins = pctrl->soc->groups[group].grp.npins; 302 301 return 0; 303 302 } 303 + EXPORT_SYMBOL_NS_GPL(intel_get_group_pins, PINCTRL_INTEL); 304 304 305 305 static void intel_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, 306 306 unsigned int pin) ··· 361 359 .pin_dbg_show = intel_pin_dbg_show, 362 360 }; 363 361 364 - static int intel_get_functions_count(struct pinctrl_dev *pctldev) 362 + int intel_get_functions_count(struct pinctrl_dev *pctldev) 365 363 { 366 364 struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 367 365 368 366 return pctrl->soc->nfunctions; 369 367 } 368 + EXPORT_SYMBOL_NS_GPL(intel_get_functions_count, PINCTRL_INTEL); 370 369 371 - static const char *intel_get_function_name(struct pinctrl_dev *pctldev, 372 - unsigned int function) 370 + const char *intel_get_function_name(struct pinctrl_dev *pctldev, unsigned int function) 373 371 { 374 372 struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 375 373 376 374 return pctrl->soc->functions[function].func.name; 377 375 } 376 + EXPORT_SYMBOL_NS_GPL(intel_get_function_name, PINCTRL_INTEL); 378 377 379 - static int intel_get_function_groups(struct pinctrl_dev *pctldev, 380 - unsigned int function, 381 - const char * const **groups, 382 - unsigned int * const ngroups) 378 + int intel_get_function_groups(struct pinctrl_dev *pctldev, unsigned int function, 379 + const char * const **groups, unsigned int * const ngroups) 383 380 { 384 381 struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 385 382 ··· 386 385 *ngroups = pctrl->soc->functions[function].func.ngroups; 387 386 return 0; 388 387 } 388 + EXPORT_SYMBOL_NS_GPL(intel_get_function_groups, PINCTRL_INTEL); 389 389 390 390 static int intel_pinmux_set_mux(struct pinctrl_dev *pctldev, 391 391 unsigned int function, unsigned int group) ··· 1668 1666 1669 1667 return intel_pinctrl_probe(pdev, data); 1670 1668 } 1671 - EXPORT_SYMBOL_GPL(intel_pinctrl_probe_by_hid); 1669 + EXPORT_SYMBOL_NS_GPL(intel_pinctrl_probe_by_hid, PINCTRL_INTEL); 1672 1670 1673 1671 int intel_pinctrl_probe_by_uid(struct platform_device *pdev) 1674 1672 { ··· 1680 1678 1681 1679 return intel_pinctrl_probe(pdev, data); 1682 1680 } 1683 - EXPORT_SYMBOL_GPL(intel_pinctrl_probe_by_uid); 1681 + EXPORT_SYMBOL_NS_GPL(intel_pinctrl_probe_by_uid, PINCTRL_INTEL); 1684 1682 1685 1683 const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_device *pdev) 1686 1684 { ··· 1712 1710 1713 1711 return data ?: ERR_PTR(-ENODATA); 1714 1712 } 1715 - EXPORT_SYMBOL_GPL(intel_pinctrl_get_soc_data); 1713 + EXPORT_SYMBOL_NS_GPL(intel_pinctrl_get_soc_data, PINCTRL_INTEL); 1716 1714 1717 1715 #ifdef CONFIG_PM_SLEEP 1718 1716 static bool __intel_gpio_is_direct_irq(u32 value)
+12
drivers/pinctrl/intel/pinctrl-intel.h
··· 266 266 intel_pinctrl_resume_noirq) \ 267 267 } 268 268 269 + struct intel_community *intel_get_community(struct intel_pinctrl *pctrl, unsigned int pin); 270 + 271 + int intel_get_groups_count(struct pinctrl_dev *pctldev); 272 + const char *intel_get_group_name(struct pinctrl_dev *pctldev, unsigned int group); 273 + int intel_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, 274 + const unsigned int **pins, unsigned int *npins); 275 + 276 + int intel_get_functions_count(struct pinctrl_dev *pctldev); 277 + const char *intel_get_function_name(struct pinctrl_dev *pctldev, unsigned int function); 278 + int intel_get_function_groups(struct pinctrl_dev *pctldev, unsigned int function, 279 + const char * const **groups, unsigned int * const ngroups); 280 + 269 281 #endif /* PINCTRL_INTEL_H */
+1
drivers/pinctrl/intel/pinctrl-jasperlake.c
··· 341 341 MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>"); 342 342 MODULE_DESCRIPTION("Intel Jasper Lake PCH pinctrl/GPIO driver"); 343 343 MODULE_LICENSE("GPL v2"); 344 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+1
drivers/pinctrl/intel/pinctrl-lakefield.c
··· 362 362 MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>"); 363 363 MODULE_DESCRIPTION("Intel Lakefield PCH pinctrl/GPIO driver"); 364 364 MODULE_LICENSE("GPL v2"); 365 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+1 -1
drivers/pinctrl/intel/pinctrl-lewisburg.c
··· 317 317 .pm = &lbg_pinctrl_pm_ops, 318 318 }, 319 319 }; 320 - 321 320 module_platform_driver(lbg_pinctrl_driver); 322 321 323 322 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); 324 323 MODULE_DESCRIPTION("Intel Lewisburg pinctrl/GPIO driver"); 325 324 MODULE_LICENSE("GPL v2"); 325 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+11 -82
drivers/pinctrl/intel/pinctrl-lynxpoint.c
··· 206 206 * IOxAPIC redirection map applies only for gpio 8-10, 13-14, 45-55. 207 207 */ 208 208 209 - static struct intel_community *lp_get_community(struct intel_pinctrl *lg, 210 - unsigned int pin) 211 - { 212 - struct intel_community *comm; 213 - int i; 214 - 215 - for (i = 0; i < lg->ncommunities; i++) { 216 - comm = &lg->communities[i]; 217 - if (pin < comm->pin_base + comm->npins && pin >= comm->pin_base) 218 - return comm; 219 - } 220 - 221 - return NULL; 222 - } 223 - 224 209 static void __iomem *lp_gpio_reg(struct gpio_chip *chip, unsigned int offset, 225 210 int reg) 226 211 { ··· 213 228 struct intel_community *comm; 214 229 int reg_offset; 215 230 216 - comm = lp_get_community(lg, offset); 231 + comm = intel_get_community(lg, offset); 217 232 if (!comm) 218 233 return NULL; 219 234 ··· 257 272 return false; 258 273 } 259 274 260 - static int lp_get_groups_count(struct pinctrl_dev *pctldev) 261 - { 262 - struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 263 - 264 - return lg->soc->ngroups; 265 - } 266 - 267 - static const char *lp_get_group_name(struct pinctrl_dev *pctldev, 268 - unsigned int selector) 269 - { 270 - struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 271 - 272 - return lg->soc->groups[selector].grp.name; 273 - } 274 - 275 - static int lp_get_group_pins(struct pinctrl_dev *pctldev, 276 - unsigned int selector, 277 - const unsigned int **pins, 278 - unsigned int *num_pins) 279 - { 280 - struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 281 - 282 - *pins = lg->soc->groups[selector].grp.pins; 283 - *num_pins = lg->soc->groups[selector].grp.npins; 284 - 285 - return 0; 286 - } 287 - 288 275 static void lp_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, 289 276 unsigned int pin) 290 277 { ··· 280 323 } 281 324 282 325 static const struct pinctrl_ops lptlp_pinctrl_ops = { 283 - .get_groups_count = lp_get_groups_count, 284 - .get_group_name = lp_get_group_name, 285 - .get_group_pins = lp_get_group_pins, 326 + .get_groups_count = intel_get_groups_count, 327 + .get_group_name = intel_get_group_name, 328 + .get_group_pins = intel_get_group_pins, 286 329 .pin_dbg_show = lp_pin_dbg_show, 287 330 }; 288 - 289 - static int lp_get_functions_count(struct pinctrl_dev *pctldev) 290 - { 291 - struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 292 - 293 - return lg->soc->nfunctions; 294 - } 295 - 296 - static const char *lp_get_function_name(struct pinctrl_dev *pctldev, 297 - unsigned int selector) 298 - { 299 - struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 300 - 301 - return lg->soc->functions[selector].func.name; 302 - } 303 - 304 - static int lp_get_function_groups(struct pinctrl_dev *pctldev, 305 - unsigned int selector, 306 - const char * const **groups, 307 - unsigned int *ngroups) 308 - { 309 - struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 310 - 311 - *groups = lg->soc->functions[selector].func.groups; 312 - *ngroups = lg->soc->functions[selector].func.ngroups; 313 - 314 - return 0; 315 - } 316 331 317 332 static int lp_pinmux_set_mux(struct pinctrl_dev *pctldev, 318 333 unsigned int function, unsigned int group) ··· 410 481 } 411 482 412 483 static const struct pinmux_ops lptlp_pinmux_ops = { 413 - .get_functions_count = lp_get_functions_count, 414 - .get_function_name = lp_get_function_name, 415 - .get_function_groups = lp_get_function_groups, 484 + .get_functions_count = intel_get_functions_count, 485 + .get_function_name = intel_get_function_name, 486 + .get_function_groups = intel_get_function_groups, 416 487 .set_mux = lp_pinmux_set_mux, 417 488 .gpio_request_enable = lp_gpio_request_enable, 418 489 .gpio_disable_free = lp_gpio_disable_free, ··· 877 948 } 878 949 879 950 static const struct dev_pm_ops lp_gpio_pm_ops = { 880 - .runtime_suspend = lp_gpio_runtime_suspend, 881 - .runtime_resume = lp_gpio_runtime_resume, 882 - .resume = lp_gpio_resume, 951 + SYSTEM_SLEEP_PM_OPS(NULL, lp_gpio_resume) 952 + RUNTIME_PM_OPS(lp_gpio_runtime_suspend, lp_gpio_runtime_resume, NULL) 883 953 }; 884 954 885 955 static const struct acpi_device_id lynxpoint_gpio_acpi_match[] = { ··· 893 965 .remove = lp_gpio_remove, 894 966 .driver = { 895 967 .name = "lp_gpio", 896 - .pm = &lp_gpio_pm_ops, 968 + .pm = pm_ptr(&lp_gpio_pm_ops), 897 969 .acpi_match_table = lynxpoint_gpio_acpi_match, 898 970 }, 899 971 }; ··· 915 987 MODULE_DESCRIPTION("Intel Lynxpoint pinctrl driver"); 916 988 MODULE_LICENSE("GPL v2"); 917 989 MODULE_ALIAS("platform:lp_gpio"); 990 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+33 -644
drivers/pinctrl/intel/pinctrl-merrifield.c
··· 6 6 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 7 7 */ 8 8 9 - #include <linux/bits.h> 10 - #include <linux/err.h> 11 - #include <linux/io.h> 12 - #include <linux/module.h> 9 + #include <linux/init.h> 10 + #include <linux/kernel.h> 13 11 #include <linux/mod_devicetable.h> 12 + #include <linux/module.h> 14 13 #include <linux/platform_device.h> 15 - #include <linux/seq_file.h> 14 + #include <linux/types.h> 16 15 17 - #include <linux/pinctrl/pinconf-generic.h> 18 - #include <linux/pinctrl/pinconf.h> 19 16 #include <linux/pinctrl/pinctrl.h> 20 - #include <linux/pinctrl/pinmux.h> 21 17 22 18 #include "pinctrl-intel.h" 23 - 24 - #define MRFLD_FAMILY_NR 64 25 - #define MRFLD_FAMILY_LEN 0x400 26 - 27 - #define SLEW_OFFSET 0x000 28 - #define BUFCFG_OFFSET 0x100 29 - #define MISC_OFFSET 0x300 30 - 31 - #define BUFCFG_PINMODE_SHIFT 0 32 - #define BUFCFG_PINMODE_MASK GENMASK(2, 0) 33 - #define BUFCFG_PINMODE_GPIO 0 34 - #define BUFCFG_PUPD_VAL_SHIFT 4 35 - #define BUFCFG_PUPD_VAL_MASK GENMASK(5, 4) 36 - #define BUFCFG_PUPD_VAL_2K 0 37 - #define BUFCFG_PUPD_VAL_20K 1 38 - #define BUFCFG_PUPD_VAL_50K 2 39 - #define BUFCFG_PUPD_VAL_910 3 40 - #define BUFCFG_PU_EN BIT(8) 41 - #define BUFCFG_PD_EN BIT(9) 42 - #define BUFCFG_Px_EN_MASK GENMASK(9, 8) 43 - #define BUFCFG_SLEWSEL BIT(10) 44 - #define BUFCFG_OVINEN BIT(12) 45 - #define BUFCFG_OVINEN_EN BIT(13) 46 - #define BUFCFG_OVINEN_MASK GENMASK(13, 12) 47 - #define BUFCFG_OVOUTEN BIT(14) 48 - #define BUFCFG_OVOUTEN_EN BIT(15) 49 - #define BUFCFG_OVOUTEN_MASK GENMASK(15, 14) 50 - #define BUFCFG_INDATAOV_VAL BIT(16) 51 - #define BUFCFG_INDATAOV_EN BIT(17) 52 - #define BUFCFG_INDATAOV_MASK GENMASK(17, 16) 53 - #define BUFCFG_OUTDATAOV_VAL BIT(18) 54 - #define BUFCFG_OUTDATAOV_EN BIT(19) 55 - #define BUFCFG_OUTDATAOV_MASK GENMASK(19, 18) 56 - #define BUFCFG_OD_EN BIT(21) 57 - 58 - /** 59 - * struct mrfld_family - Intel pin family description 60 - * @barno: MMIO BAR number where registers for this family reside 61 - * @pin_base: Starting pin of pins in this family 62 - * @npins: Number of pins in this family 63 - * @protected: True if family is protected by access 64 - * @regs: family specific common registers 65 - */ 66 - struct mrfld_family { 67 - unsigned int barno; 68 - unsigned int pin_base; 69 - size_t npins; 70 - bool protected; 71 - void __iomem *regs; 72 - }; 73 - 74 - #define MRFLD_FAMILY(b, s, e) \ 75 - { \ 76 - .barno = (b), \ 77 - .pin_base = (s), \ 78 - .npins = (e) - (s) + 1, \ 79 - } 80 - 81 - #define MRFLD_FAMILY_PROTECTED(b, s, e) \ 82 - { \ 83 - .barno = (b), \ 84 - .pin_base = (s), \ 85 - .npins = (e) - (s) + 1, \ 86 - .protected = true, \ 87 - } 19 + #include "pinctrl-tangier.h" 88 20 89 21 static const struct pinctrl_pin_desc mrfld_pins[] = { 90 22 /* Family 0: OCP2SSC (0 pins) */ ··· 321 389 FUNCTION("pwm3", mrfld_pwm3_groups), 322 390 }; 323 391 324 - static const struct mrfld_family mrfld_families[] = { 325 - MRFLD_FAMILY(1, 0, 12), 326 - MRFLD_FAMILY(2, 13, 36), 327 - MRFLD_FAMILY(3, 37, 56), 328 - MRFLD_FAMILY(4, 57, 64), 329 - MRFLD_FAMILY(5, 65, 78), 330 - MRFLD_FAMILY(6, 79, 100), 331 - MRFLD_FAMILY_PROTECTED(7, 101, 114), 332 - MRFLD_FAMILY(8, 115, 126), 333 - MRFLD_FAMILY(9, 127, 145), 334 - MRFLD_FAMILY(10, 146, 157), 335 - MRFLD_FAMILY(11, 158, 179), 336 - MRFLD_FAMILY_PROTECTED(12, 180, 194), 337 - MRFLD_FAMILY(13, 195, 214), 338 - MRFLD_FAMILY(14, 215, 227), 339 - MRFLD_FAMILY(15, 228, 232), 392 + static const struct tng_family mrfld_families[] = { 393 + TNG_FAMILY(1, 0, 12), 394 + TNG_FAMILY(2, 13, 36), 395 + TNG_FAMILY(3, 37, 56), 396 + TNG_FAMILY(4, 57, 64), 397 + TNG_FAMILY(5, 65, 78), 398 + TNG_FAMILY(6, 79, 100), 399 + TNG_FAMILY_PROTECTED(7, 101, 114), 400 + TNG_FAMILY(8, 115, 126), 401 + TNG_FAMILY(9, 127, 145), 402 + TNG_FAMILY(10, 146, 157), 403 + TNG_FAMILY(11, 158, 179), 404 + TNG_FAMILY_PROTECTED(12, 180, 194), 405 + TNG_FAMILY(13, 195, 214), 406 + TNG_FAMILY(14, 215, 227), 407 + TNG_FAMILY(15, 228, 232), 340 408 }; 341 409 342 - /** 343 - * struct mrfld_pinctrl - Intel Merrifield pinctrl private structure 344 - * @dev: Pointer to the device structure 345 - * @lock: Lock to serialize register access 346 - * @pctldesc: Pin controller description 347 - * @pctldev: Pointer to the pin controller device 348 - * @families: Array of families this pinctrl handles 349 - * @nfamilies: Number of families in the array 350 - * @functions: Array of functions 351 - * @nfunctions: Number of functions in the array 352 - * @groups: Array of pin groups 353 - * @ngroups: Number of groups in the array 354 - * @pins: Array of pins this pinctrl controls 355 - * @npins: Number of pins in the array 356 - */ 357 - struct mrfld_pinctrl { 358 - struct device *dev; 359 - raw_spinlock_t lock; 360 - struct pinctrl_desc pctldesc; 361 - struct pinctrl_dev *pctldev; 362 - 363 - /* Pin controller configuration */ 364 - const struct mrfld_family *families; 365 - size_t nfamilies; 366 - const struct intel_function *functions; 367 - size_t nfunctions; 368 - const struct intel_pingroup *groups; 369 - size_t ngroups; 370 - const struct pinctrl_pin_desc *pins; 371 - size_t npins; 410 + static const struct tng_pinctrl mrfld_soc_data = { 411 + .pins = mrfld_pins, 412 + .npins = ARRAY_SIZE(mrfld_pins), 413 + .groups = mrfld_groups, 414 + .ngroups = ARRAY_SIZE(mrfld_groups), 415 + .families = mrfld_families, 416 + .nfamilies = ARRAY_SIZE(mrfld_families), 417 + .functions = mrfld_functions, 418 + .nfunctions = ARRAY_SIZE(mrfld_functions), 372 419 }; 373 - 374 - #define pin_to_bufno(f, p) ((p) - (f)->pin_base) 375 - 376 - static const struct mrfld_family *mrfld_get_family(struct mrfld_pinctrl *mp, 377 - unsigned int pin) 378 - { 379 - const struct mrfld_family *family; 380 - unsigned int i; 381 - 382 - for (i = 0; i < mp->nfamilies; i++) { 383 - family = &mp->families[i]; 384 - if (pin >= family->pin_base && 385 - pin < family->pin_base + family->npins) 386 - return family; 387 - } 388 - 389 - dev_warn(mp->dev, "failed to find family for pin %u\n", pin); 390 - return NULL; 391 - } 392 - 393 - static bool mrfld_buf_available(struct mrfld_pinctrl *mp, unsigned int pin) 394 - { 395 - const struct mrfld_family *family; 396 - 397 - family = mrfld_get_family(mp, pin); 398 - if (!family) 399 - return false; 400 - 401 - return !family->protected; 402 - } 403 - 404 - static void __iomem *mrfld_get_bufcfg(struct mrfld_pinctrl *mp, unsigned int pin) 405 - { 406 - const struct mrfld_family *family; 407 - unsigned int bufno; 408 - 409 - family = mrfld_get_family(mp, pin); 410 - if (!family) 411 - return NULL; 412 - 413 - bufno = pin_to_bufno(family, pin); 414 - return family->regs + BUFCFG_OFFSET + bufno * 4; 415 - } 416 - 417 - static int mrfld_read_bufcfg(struct mrfld_pinctrl *mp, unsigned int pin, u32 *value) 418 - { 419 - void __iomem *bufcfg; 420 - 421 - if (!mrfld_buf_available(mp, pin)) 422 - return -EBUSY; 423 - 424 - bufcfg = mrfld_get_bufcfg(mp, pin); 425 - *value = readl(bufcfg); 426 - 427 - return 0; 428 - } 429 - 430 - static void mrfld_update_bufcfg(struct mrfld_pinctrl *mp, unsigned int pin, 431 - u32 bits, u32 mask) 432 - { 433 - void __iomem *bufcfg; 434 - u32 value; 435 - 436 - bufcfg = mrfld_get_bufcfg(mp, pin); 437 - value = readl(bufcfg); 438 - 439 - value &= ~mask; 440 - value |= bits & mask; 441 - 442 - writel(value, bufcfg); 443 - } 444 - 445 - static int mrfld_get_groups_count(struct pinctrl_dev *pctldev) 446 - { 447 - struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 448 - 449 - return mp->ngroups; 450 - } 451 - 452 - static const char *mrfld_get_group_name(struct pinctrl_dev *pctldev, 453 - unsigned int group) 454 - { 455 - struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 456 - 457 - return mp->groups[group].grp.name; 458 - } 459 - 460 - static int mrfld_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, 461 - const unsigned int **pins, unsigned int *npins) 462 - { 463 - struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 464 - 465 - *pins = mp->groups[group].grp.pins; 466 - *npins = mp->groups[group].grp.npins; 467 - return 0; 468 - } 469 - 470 - static void mrfld_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, 471 - unsigned int pin) 472 - { 473 - struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 474 - u32 value, mode; 475 - int ret; 476 - 477 - ret = mrfld_read_bufcfg(mp, pin, &value); 478 - if (ret) { 479 - seq_puts(s, "not available"); 480 - return; 481 - } 482 - 483 - mode = (value & BUFCFG_PINMODE_MASK) >> BUFCFG_PINMODE_SHIFT; 484 - if (mode == BUFCFG_PINMODE_GPIO) 485 - seq_puts(s, "GPIO "); 486 - else 487 - seq_printf(s, "mode %d ", mode); 488 - 489 - seq_printf(s, "0x%08x", value); 490 - } 491 - 492 - static const struct pinctrl_ops mrfld_pinctrl_ops = { 493 - .get_groups_count = mrfld_get_groups_count, 494 - .get_group_name = mrfld_get_group_name, 495 - .get_group_pins = mrfld_get_group_pins, 496 - .pin_dbg_show = mrfld_pin_dbg_show, 497 - }; 498 - 499 - static int mrfld_get_functions_count(struct pinctrl_dev *pctldev) 500 - { 501 - struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 502 - 503 - return mp->nfunctions; 504 - } 505 - 506 - static const char *mrfld_get_function_name(struct pinctrl_dev *pctldev, 507 - unsigned int function) 508 - { 509 - struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 510 - 511 - return mp->functions[function].func.name; 512 - } 513 - 514 - static int mrfld_get_function_groups(struct pinctrl_dev *pctldev, 515 - unsigned int function, 516 - const char * const **groups, 517 - unsigned int * const ngroups) 518 - { 519 - struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 520 - 521 - *groups = mp->functions[function].func.groups; 522 - *ngroups = mp->functions[function].func.ngroups; 523 - return 0; 524 - } 525 - 526 - static int mrfld_pinmux_set_mux(struct pinctrl_dev *pctldev, 527 - unsigned int function, 528 - unsigned int group) 529 - { 530 - struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 531 - const struct intel_pingroup *grp = &mp->groups[group]; 532 - u32 bits = grp->mode << BUFCFG_PINMODE_SHIFT; 533 - u32 mask = BUFCFG_PINMODE_MASK; 534 - unsigned long flags; 535 - unsigned int i; 536 - 537 - /* 538 - * All pins in the groups needs to be accessible and writable 539 - * before we can enable the mux for this group. 540 - */ 541 - for (i = 0; i < grp->grp.npins; i++) { 542 - if (!mrfld_buf_available(mp, grp->grp.pins[i])) 543 - return -EBUSY; 544 - } 545 - 546 - /* Now enable the mux setting for each pin in the group */ 547 - raw_spin_lock_irqsave(&mp->lock, flags); 548 - for (i = 0; i < grp->grp.npins; i++) 549 - mrfld_update_bufcfg(mp, grp->grp.pins[i], bits, mask); 550 - raw_spin_unlock_irqrestore(&mp->lock, flags); 551 - 552 - return 0; 553 - } 554 - 555 - static int mrfld_gpio_request_enable(struct pinctrl_dev *pctldev, 556 - struct pinctrl_gpio_range *range, 557 - unsigned int pin) 558 - { 559 - struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 560 - u32 bits = BUFCFG_PINMODE_GPIO << BUFCFG_PINMODE_SHIFT; 561 - u32 mask = BUFCFG_PINMODE_MASK; 562 - unsigned long flags; 563 - 564 - if (!mrfld_buf_available(mp, pin)) 565 - return -EBUSY; 566 - 567 - raw_spin_lock_irqsave(&mp->lock, flags); 568 - mrfld_update_bufcfg(mp, pin, bits, mask); 569 - raw_spin_unlock_irqrestore(&mp->lock, flags); 570 - 571 - return 0; 572 - } 573 - 574 - static const struct pinmux_ops mrfld_pinmux_ops = { 575 - .get_functions_count = mrfld_get_functions_count, 576 - .get_function_name = mrfld_get_function_name, 577 - .get_function_groups = mrfld_get_function_groups, 578 - .set_mux = mrfld_pinmux_set_mux, 579 - .gpio_request_enable = mrfld_gpio_request_enable, 580 - }; 581 - 582 - static int mrfld_config_get(struct pinctrl_dev *pctldev, unsigned int pin, 583 - unsigned long *config) 584 - { 585 - struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 586 - enum pin_config_param param = pinconf_to_config_param(*config); 587 - u32 value, term; 588 - u16 arg = 0; 589 - int ret; 590 - 591 - ret = mrfld_read_bufcfg(mp, pin, &value); 592 - if (ret) 593 - return -ENOTSUPP; 594 - 595 - term = (value & BUFCFG_PUPD_VAL_MASK) >> BUFCFG_PUPD_VAL_SHIFT; 596 - 597 - switch (param) { 598 - case PIN_CONFIG_BIAS_DISABLE: 599 - if (value & BUFCFG_Px_EN_MASK) 600 - return -EINVAL; 601 - break; 602 - 603 - case PIN_CONFIG_BIAS_PULL_UP: 604 - if ((value & BUFCFG_Px_EN_MASK) != BUFCFG_PU_EN) 605 - return -EINVAL; 606 - 607 - switch (term) { 608 - case BUFCFG_PUPD_VAL_910: 609 - arg = 910; 610 - break; 611 - case BUFCFG_PUPD_VAL_2K: 612 - arg = 2000; 613 - break; 614 - case BUFCFG_PUPD_VAL_20K: 615 - arg = 20000; 616 - break; 617 - case BUFCFG_PUPD_VAL_50K: 618 - arg = 50000; 619 - break; 620 - } 621 - 622 - break; 623 - 624 - case PIN_CONFIG_BIAS_PULL_DOWN: 625 - if ((value & BUFCFG_Px_EN_MASK) != BUFCFG_PD_EN) 626 - return -EINVAL; 627 - 628 - switch (term) { 629 - case BUFCFG_PUPD_VAL_910: 630 - arg = 910; 631 - break; 632 - case BUFCFG_PUPD_VAL_2K: 633 - arg = 2000; 634 - break; 635 - case BUFCFG_PUPD_VAL_20K: 636 - arg = 20000; 637 - break; 638 - case BUFCFG_PUPD_VAL_50K: 639 - arg = 50000; 640 - break; 641 - } 642 - 643 - break; 644 - 645 - case PIN_CONFIG_DRIVE_PUSH_PULL: 646 - if (value & BUFCFG_OD_EN) 647 - return -EINVAL; 648 - break; 649 - 650 - case PIN_CONFIG_DRIVE_OPEN_DRAIN: 651 - if (!(value & BUFCFG_OD_EN)) 652 - return -EINVAL; 653 - break; 654 - 655 - case PIN_CONFIG_SLEW_RATE: 656 - if (!(value & BUFCFG_SLEWSEL)) 657 - arg = 0; 658 - else 659 - arg = 1; 660 - break; 661 - 662 - default: 663 - return -ENOTSUPP; 664 - } 665 - 666 - *config = pinconf_to_config_packed(param, arg); 667 - return 0; 668 - } 669 - 670 - static int mrfld_config_set_pin(struct mrfld_pinctrl *mp, unsigned int pin, 671 - unsigned long config) 672 - { 673 - unsigned int param = pinconf_to_config_param(config); 674 - unsigned int arg = pinconf_to_config_argument(config); 675 - u32 bits = 0, mask = 0; 676 - unsigned long flags; 677 - 678 - switch (param) { 679 - case PIN_CONFIG_BIAS_DISABLE: 680 - mask |= BUFCFG_Px_EN_MASK | BUFCFG_PUPD_VAL_MASK; 681 - break; 682 - 683 - case PIN_CONFIG_BIAS_PULL_UP: 684 - mask |= BUFCFG_Px_EN_MASK | BUFCFG_PUPD_VAL_MASK; 685 - bits |= BUFCFG_PU_EN; 686 - 687 - /* Set default strength value in case none is given */ 688 - if (arg == 1) 689 - arg = 20000; 690 - 691 - switch (arg) { 692 - case 50000: 693 - bits |= BUFCFG_PUPD_VAL_50K << BUFCFG_PUPD_VAL_SHIFT; 694 - break; 695 - case 20000: 696 - bits |= BUFCFG_PUPD_VAL_20K << BUFCFG_PUPD_VAL_SHIFT; 697 - break; 698 - case 2000: 699 - bits |= BUFCFG_PUPD_VAL_2K << BUFCFG_PUPD_VAL_SHIFT; 700 - break; 701 - default: 702 - return -EINVAL; 703 - } 704 - 705 - break; 706 - 707 - case PIN_CONFIG_BIAS_PULL_DOWN: 708 - mask |= BUFCFG_Px_EN_MASK | BUFCFG_PUPD_VAL_MASK; 709 - bits |= BUFCFG_PD_EN; 710 - 711 - /* Set default strength value in case none is given */ 712 - if (arg == 1) 713 - arg = 20000; 714 - 715 - switch (arg) { 716 - case 50000: 717 - bits |= BUFCFG_PUPD_VAL_50K << BUFCFG_PUPD_VAL_SHIFT; 718 - break; 719 - case 20000: 720 - bits |= BUFCFG_PUPD_VAL_20K << BUFCFG_PUPD_VAL_SHIFT; 721 - break; 722 - case 2000: 723 - bits |= BUFCFG_PUPD_VAL_2K << BUFCFG_PUPD_VAL_SHIFT; 724 - break; 725 - default: 726 - return -EINVAL; 727 - } 728 - 729 - break; 730 - 731 - case PIN_CONFIG_DRIVE_PUSH_PULL: 732 - mask |= BUFCFG_OD_EN; 733 - bits &= ~BUFCFG_OD_EN; 734 - break; 735 - 736 - case PIN_CONFIG_DRIVE_OPEN_DRAIN: 737 - mask |= BUFCFG_OD_EN; 738 - bits |= BUFCFG_OD_EN; 739 - break; 740 - 741 - case PIN_CONFIG_SLEW_RATE: 742 - mask |= BUFCFG_SLEWSEL; 743 - if (arg) 744 - bits |= BUFCFG_SLEWSEL; 745 - break; 746 - } 747 - 748 - raw_spin_lock_irqsave(&mp->lock, flags); 749 - mrfld_update_bufcfg(mp, pin, bits, mask); 750 - raw_spin_unlock_irqrestore(&mp->lock, flags); 751 - 752 - return 0; 753 - } 754 - 755 - static int mrfld_config_set(struct pinctrl_dev *pctldev, unsigned int pin, 756 - unsigned long *configs, unsigned int nconfigs) 757 - { 758 - struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 759 - unsigned int i; 760 - int ret; 761 - 762 - if (!mrfld_buf_available(mp, pin)) 763 - return -ENOTSUPP; 764 - 765 - for (i = 0; i < nconfigs; i++) { 766 - switch (pinconf_to_config_param(configs[i])) { 767 - case PIN_CONFIG_BIAS_DISABLE: 768 - case PIN_CONFIG_BIAS_PULL_UP: 769 - case PIN_CONFIG_BIAS_PULL_DOWN: 770 - case PIN_CONFIG_DRIVE_PUSH_PULL: 771 - case PIN_CONFIG_DRIVE_OPEN_DRAIN: 772 - case PIN_CONFIG_SLEW_RATE: 773 - ret = mrfld_config_set_pin(mp, pin, configs[i]); 774 - if (ret) 775 - return ret; 776 - break; 777 - 778 - default: 779 - return -ENOTSUPP; 780 - } 781 - } 782 - 783 - return 0; 784 - } 785 - 786 - static int mrfld_config_group_get(struct pinctrl_dev *pctldev, 787 - unsigned int group, unsigned long *config) 788 - { 789 - const unsigned int *pins; 790 - unsigned int npins; 791 - int ret; 792 - 793 - ret = mrfld_get_group_pins(pctldev, group, &pins, &npins); 794 - if (ret) 795 - return ret; 796 - 797 - ret = mrfld_config_get(pctldev, pins[0], config); 798 - if (ret) 799 - return ret; 800 - 801 - return 0; 802 - } 803 - 804 - static int mrfld_config_group_set(struct pinctrl_dev *pctldev, 805 - unsigned int group, unsigned long *configs, 806 - unsigned int num_configs) 807 - { 808 - const unsigned int *pins; 809 - unsigned int npins; 810 - int i, ret; 811 - 812 - ret = mrfld_get_group_pins(pctldev, group, &pins, &npins); 813 - if (ret) 814 - return ret; 815 - 816 - for (i = 0; i < npins; i++) { 817 - ret = mrfld_config_set(pctldev, pins[i], configs, num_configs); 818 - if (ret) 819 - return ret; 820 - } 821 - 822 - return 0; 823 - } 824 - 825 - static const struct pinconf_ops mrfld_pinconf_ops = { 826 - .is_generic = true, 827 - .pin_config_get = mrfld_config_get, 828 - .pin_config_set = mrfld_config_set, 829 - .pin_config_group_get = mrfld_config_group_get, 830 - .pin_config_group_set = mrfld_config_group_set, 831 - }; 832 - 833 - static const struct pinctrl_desc mrfld_pinctrl_desc = { 834 - .pctlops = &mrfld_pinctrl_ops, 835 - .pmxops = &mrfld_pinmux_ops, 836 - .confops = &mrfld_pinconf_ops, 837 - .owner = THIS_MODULE, 838 - }; 839 - 840 - static int mrfld_pinctrl_probe(struct platform_device *pdev) 841 - { 842 - struct device *dev = &pdev->dev; 843 - struct mrfld_family *families; 844 - struct mrfld_pinctrl *mp; 845 - void __iomem *regs; 846 - size_t nfamilies; 847 - unsigned int i; 848 - 849 - mp = devm_kzalloc(dev, sizeof(*mp), GFP_KERNEL); 850 - if (!mp) 851 - return -ENOMEM; 852 - 853 - mp->dev = dev; 854 - raw_spin_lock_init(&mp->lock); 855 - 856 - regs = devm_platform_ioremap_resource(pdev, 0); 857 - if (IS_ERR(regs)) 858 - return PTR_ERR(regs); 859 - 860 - /* 861 - * Make a copy of the families which we can use to hold pointers 862 - * to the registers. 863 - */ 864 - nfamilies = ARRAY_SIZE(mrfld_families), 865 - families = devm_kmemdup(dev, mrfld_families, sizeof(mrfld_families), GFP_KERNEL); 866 - if (!families) 867 - return -ENOMEM; 868 - 869 - /* Splice memory resource by chunk per family */ 870 - for (i = 0; i < nfamilies; i++) { 871 - struct mrfld_family *family = &families[i]; 872 - 873 - family->regs = regs + family->barno * MRFLD_FAMILY_LEN; 874 - } 875 - 876 - mp->families = families; 877 - mp->nfamilies = nfamilies; 878 - mp->functions = mrfld_functions; 879 - mp->nfunctions = ARRAY_SIZE(mrfld_functions); 880 - mp->groups = mrfld_groups; 881 - mp->ngroups = ARRAY_SIZE(mrfld_groups); 882 - mp->pctldesc = mrfld_pinctrl_desc; 883 - mp->pctldesc.name = dev_name(dev); 884 - mp->pctldesc.pins = mrfld_pins; 885 - mp->pctldesc.npins = ARRAY_SIZE(mrfld_pins); 886 - 887 - mp->pctldev = devm_pinctrl_register(dev, &mp->pctldesc, mp); 888 - if (IS_ERR(mp->pctldev)) { 889 - dev_err(dev, "failed to register pinctrl driver\n"); 890 - return PTR_ERR(mp->pctldev); 891 - } 892 - 893 - platform_set_drvdata(pdev, mp); 894 - return 0; 895 - } 896 420 897 421 static const struct acpi_device_id mrfld_acpi_table[] = { 898 - { "INTC1002" }, 422 + { "INTC1002", (kernel_ulong_t)&mrfld_soc_data }, 899 423 { } 900 424 }; 901 425 MODULE_DEVICE_TABLE(acpi, mrfld_acpi_table); 902 426 903 427 static struct platform_driver mrfld_pinctrl_driver = { 904 - .probe = mrfld_pinctrl_probe, 428 + .probe = devm_tng_pinctrl_probe, 905 429 .driver = { 906 430 .name = "pinctrl-merrifield", 907 431 .acpi_match_table = mrfld_acpi_table, ··· 380 992 MODULE_DESCRIPTION("Intel Merrifield SoC pinctrl driver"); 381 993 MODULE_LICENSE("GPL v2"); 382 994 MODULE_ALIAS("platform:pinctrl-merrifield"); 995 + MODULE_IMPORT_NS(PINCTRL_TANGIER);
+1
drivers/pinctrl/intel/pinctrl-meteorlake.c
··· 604 604 MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>"); 605 605 MODULE_DESCRIPTION("Intel Meteor Lake PCH pinctrl/GPIO driver"); 606 606 MODULE_LICENSE("GPL v2"); 607 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+29 -611
drivers/pinctrl/intel/pinctrl-moorefield.c
··· 6 6 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 7 7 */ 8 8 9 - #include <linux/bits.h> 10 - #include <linux/err.h> 11 - #include <linux/io.h> 12 - #include <linux/module.h> 9 + #include <linux/init.h> 10 + #include <linux/kernel.h> 13 11 #include <linux/mod_devicetable.h> 12 + #include <linux/module.h> 14 13 #include <linux/platform_device.h> 15 - #include <linux/seq_file.h> 14 + #include <linux/types.h> 16 15 17 - #include <linux/pinctrl/pinconf-generic.h> 18 - #include <linux/pinctrl/pinconf.h> 19 16 #include <linux/pinctrl/pinctrl.h> 20 - #include <linux/pinctrl/pinmux.h> 21 17 22 - #include "pinctrl-intel.h" 23 - 24 - #define MOFLD_FAMILY_NR 64 25 - #define MOFLD_FAMILY_LEN 0x400 26 - 27 - #define SLEW_OFFSET 0x000 28 - #define BUFCFG_OFFSET 0x100 29 - #define MISC_OFFSET 0x300 30 - 31 - #define BUFCFG_PINMODE_SHIFT 0 32 - #define BUFCFG_PINMODE_MASK GENMASK(2, 0) 33 - #define BUFCFG_PINMODE_GPIO 0 34 - #define BUFCFG_PUPD_VAL_SHIFT 4 35 - #define BUFCFG_PUPD_VAL_MASK GENMASK(5, 4) 36 - #define BUFCFG_PUPD_VAL_2K 0 37 - #define BUFCFG_PUPD_VAL_20K 1 38 - #define BUFCFG_PUPD_VAL_50K 2 39 - #define BUFCFG_PUPD_VAL_910 3 40 - #define BUFCFG_PU_EN BIT(8) 41 - #define BUFCFG_PD_EN BIT(9) 42 - #define BUFCFG_Px_EN_MASK GENMASK(9, 8) 43 - #define BUFCFG_SLEWSEL BIT(10) 44 - #define BUFCFG_OVINEN BIT(12) 45 - #define BUFCFG_OVINEN_EN BIT(13) 46 - #define BUFCFG_OVINEN_MASK GENMASK(13, 12) 47 - #define BUFCFG_OVOUTEN BIT(14) 48 - #define BUFCFG_OVOUTEN_EN BIT(15) 49 - #define BUFCFG_OVOUTEN_MASK GENMASK(15, 14) 50 - #define BUFCFG_INDATAOV_VAL BIT(16) 51 - #define BUFCFG_INDATAOV_EN BIT(17) 52 - #define BUFCFG_INDATAOV_MASK GENMASK(17, 16) 53 - #define BUFCFG_OUTDATAOV_VAL BIT(18) 54 - #define BUFCFG_OUTDATAOV_EN BIT(19) 55 - #define BUFCFG_OUTDATAOV_MASK GENMASK(19, 18) 56 - #define BUFCFG_OD_EN BIT(21) 57 - 58 - /** 59 - * struct mofld_family - Intel pin family description 60 - * @barno: MMIO BAR number where registers for this family reside 61 - * @pin_base: Starting pin of pins in this family 62 - * @npins: Number of pins in this family 63 - * @protected: True if family is protected by access 64 - * @regs: family specific common registers 65 - */ 66 - struct mofld_family { 67 - unsigned int barno; 68 - unsigned int pin_base; 69 - size_t npins; 70 - bool protected; 71 - void __iomem *regs; 72 - }; 73 - 74 - #define MOFLD_FAMILY(b, s, e) \ 75 - { \ 76 - .barno = (b), \ 77 - .pin_base = (s), \ 78 - .npins = (e) - (s) + 1, \ 79 - } 18 + #include "pinctrl-tangier.h" 80 19 81 20 static const struct pinctrl_pin_desc mofld_pins[] = { 82 21 /* ULPI (13 pins) */ ··· 286 347 PINCTRL_PIN(250, "JTAG_TRST"), 287 348 }; 288 349 289 - static const struct mofld_family mofld_families[] = { 290 - MOFLD_FAMILY(0, 0, 12), 291 - MOFLD_FAMILY(1, 13, 24), 292 - MOFLD_FAMILY(2, 25, 44), 293 - MOFLD_FAMILY(3, 45, 52), 294 - MOFLD_FAMILY(4, 53, 66), 295 - MOFLD_FAMILY(5, 67, 88), 296 - MOFLD_FAMILY(6, 89, 108), 297 - MOFLD_FAMILY(7, 109, 131), 298 - MOFLD_FAMILY(8, 132, 151), 299 - MOFLD_FAMILY(9, 152, 166), 300 - MOFLD_FAMILY(10, 167, 180), 301 - MOFLD_FAMILY(11, 181, 195), 302 - MOFLD_FAMILY(12, 196, 215), 303 - MOFLD_FAMILY(13, 216, 228), 304 - MOFLD_FAMILY(14, 229, 250), 350 + static const struct tng_family mofld_families[] = { 351 + TNG_FAMILY(0, 0, 12), 352 + TNG_FAMILY(1, 13, 24), 353 + TNG_FAMILY(2, 25, 44), 354 + TNG_FAMILY(3, 45, 52), 355 + TNG_FAMILY(4, 53, 66), 356 + TNG_FAMILY(5, 67, 88), 357 + TNG_FAMILY(6, 89, 108), 358 + TNG_FAMILY(7, 109, 131), 359 + TNG_FAMILY(8, 132, 151), 360 + TNG_FAMILY(9, 152, 166), 361 + TNG_FAMILY(10, 167, 180), 362 + TNG_FAMILY(11, 181, 195), 363 + TNG_FAMILY(12, 196, 215), 364 + TNG_FAMILY(13, 216, 228), 365 + TNG_FAMILY(14, 229, 250), 305 366 }; 306 367 307 - /** 308 - * struct mofld_pinctrl - Intel Merrifield pinctrl private structure 309 - * @dev: Pointer to the device structure 310 - * @lock: Lock to serialize register access 311 - * @pctldesc: Pin controller description 312 - * @pctldev: Pointer to the pin controller device 313 - * @families: Array of families this pinctrl handles 314 - * @nfamilies: Number of families in the array 315 - * @functions: Array of functions 316 - * @nfunctions: Number of functions in the array 317 - * @groups: Array of pin groups 318 - * @ngroups: Number of groups in the array 319 - * @pins: Array of pins this pinctrl controls 320 - * @npins: Number of pins in the array 321 - */ 322 - struct mofld_pinctrl { 323 - struct device *dev; 324 - raw_spinlock_t lock; 325 - struct pinctrl_desc pctldesc; 326 - struct pinctrl_dev *pctldev; 327 - 328 - /* Pin controller configuration */ 329 - const struct mofld_family *families; 330 - size_t nfamilies; 331 - const struct intel_function *functions; 332 - size_t nfunctions; 333 - const struct intel_pingroup *groups; 334 - size_t ngroups; 335 - const struct pinctrl_pin_desc *pins; 336 - size_t npins; 368 + static const struct tng_pinctrl mofld_soc_data = { 369 + .pins = mofld_pins, 370 + .npins = ARRAY_SIZE(mofld_pins), 371 + .families = mofld_families, 372 + .nfamilies = ARRAY_SIZE(mofld_families), 337 373 }; 338 - 339 - #define pin_to_bufno(f, p) ((p) - (f)->pin_base) 340 - 341 - static const struct mofld_family *mofld_get_family(struct mofld_pinctrl *mp, unsigned int pin) 342 - { 343 - const struct mofld_family *family; 344 - unsigned int i; 345 - 346 - for (i = 0; i < mp->nfamilies; i++) { 347 - family = &mp->families[i]; 348 - if (pin >= family->pin_base && 349 - pin < family->pin_base + family->npins) 350 - return family; 351 - } 352 - 353 - dev_warn(mp->dev, "failed to find family for pin %u\n", pin); 354 - return NULL; 355 - } 356 - 357 - static bool mofld_buf_available(struct mofld_pinctrl *mp, unsigned int pin) 358 - { 359 - const struct mofld_family *family; 360 - 361 - family = mofld_get_family(mp, pin); 362 - if (!family) 363 - return false; 364 - 365 - return !family->protected; 366 - } 367 - 368 - static void __iomem *mofld_get_bufcfg(struct mofld_pinctrl *mp, unsigned int pin) 369 - { 370 - const struct mofld_family *family; 371 - unsigned int bufno; 372 - 373 - family = mofld_get_family(mp, pin); 374 - if (!family) 375 - return NULL; 376 - 377 - bufno = pin_to_bufno(family, pin); 378 - return family->regs + BUFCFG_OFFSET + bufno * 4; 379 - } 380 - 381 - static int mofld_read_bufcfg(struct mofld_pinctrl *mp, unsigned int pin, u32 *value) 382 - { 383 - void __iomem *bufcfg; 384 - 385 - if (!mofld_buf_available(mp, pin)) 386 - return -EBUSY; 387 - 388 - bufcfg = mofld_get_bufcfg(mp, pin); 389 - *value = readl(bufcfg); 390 - 391 - return 0; 392 - } 393 - 394 - static void mofld_update_bufcfg(struct mofld_pinctrl *mp, unsigned int pin, u32 bits, u32 mask) 395 - { 396 - void __iomem *bufcfg; 397 - u32 value; 398 - 399 - bufcfg = mofld_get_bufcfg(mp, pin); 400 - value = readl(bufcfg); 401 - 402 - value &= ~mask; 403 - value |= bits & mask; 404 - 405 - writel(value, bufcfg); 406 - } 407 - 408 - static int mofld_get_groups_count(struct pinctrl_dev *pctldev) 409 - { 410 - struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 411 - 412 - return mp->ngroups; 413 - } 414 - 415 - static const char *mofld_get_group_name(struct pinctrl_dev *pctldev, unsigned int group) 416 - { 417 - struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 418 - 419 - return mp->groups[group].grp.name; 420 - } 421 - 422 - static int mofld_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, 423 - const unsigned int **pins, unsigned int *npins) 424 - { 425 - struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 426 - 427 - *pins = mp->groups[group].grp.pins; 428 - *npins = mp->groups[group].grp.npins; 429 - return 0; 430 - } 431 - 432 - static void mofld_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, 433 - unsigned int pin) 434 - { 435 - struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 436 - u32 value, mode; 437 - int ret; 438 - 439 - ret = mofld_read_bufcfg(mp, pin, &value); 440 - if (ret) { 441 - seq_puts(s, "not available"); 442 - return; 443 - } 444 - 445 - mode = (value & BUFCFG_PINMODE_MASK) >> BUFCFG_PINMODE_SHIFT; 446 - if (mode == BUFCFG_PINMODE_GPIO) 447 - seq_puts(s, "GPIO "); 448 - else 449 - seq_printf(s, "mode %d ", mode); 450 - 451 - seq_printf(s, "0x%08x", value); 452 - } 453 - 454 - static const struct pinctrl_ops mofld_pinctrl_ops = { 455 - .get_groups_count = mofld_get_groups_count, 456 - .get_group_name = mofld_get_group_name, 457 - .get_group_pins = mofld_get_group_pins, 458 - .pin_dbg_show = mofld_pin_dbg_show, 459 - }; 460 - 461 - static int mofld_get_functions_count(struct pinctrl_dev *pctldev) 462 - { 463 - struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 464 - 465 - return mp->nfunctions; 466 - } 467 - 468 - static const char *mofld_get_function_name(struct pinctrl_dev *pctldev, unsigned int function) 469 - { 470 - struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 471 - 472 - return mp->functions[function].func.name; 473 - } 474 - 475 - static int mofld_get_function_groups(struct pinctrl_dev *pctldev, unsigned int function, 476 - const char * const **groups, unsigned int * const ngroups) 477 - { 478 - struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 479 - 480 - *groups = mp->functions[function].func.groups; 481 - *ngroups = mp->functions[function].func.ngroups; 482 - return 0; 483 - } 484 - 485 - static int mofld_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function, 486 - unsigned int group) 487 - { 488 - struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 489 - const struct intel_pingroup *grp = &mp->groups[group]; 490 - u32 bits = grp->mode << BUFCFG_PINMODE_SHIFT; 491 - u32 mask = BUFCFG_PINMODE_MASK; 492 - unsigned long flags; 493 - unsigned int i; 494 - 495 - /* 496 - * All pins in the groups needs to be accessible and writable 497 - * before we can enable the mux for this group. 498 - */ 499 - for (i = 0; i < grp->grp.npins; i++) { 500 - if (!mofld_buf_available(mp, grp->grp.pins[i])) 501 - return -EBUSY; 502 - } 503 - 504 - /* Now enable the mux setting for each pin in the group */ 505 - raw_spin_lock_irqsave(&mp->lock, flags); 506 - for (i = 0; i < grp->grp.npins; i++) 507 - mofld_update_bufcfg(mp, grp->grp.pins[i], bits, mask); 508 - raw_spin_unlock_irqrestore(&mp->lock, flags); 509 - 510 - return 0; 511 - } 512 - 513 - static int mofld_gpio_request_enable(struct pinctrl_dev *pctldev, 514 - struct pinctrl_gpio_range *range, 515 - unsigned int pin) 516 - { 517 - struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 518 - u32 bits = BUFCFG_PINMODE_GPIO << BUFCFG_PINMODE_SHIFT; 519 - u32 mask = BUFCFG_PINMODE_MASK; 520 - unsigned long flags; 521 - 522 - if (!mofld_buf_available(mp, pin)) 523 - return -EBUSY; 524 - 525 - raw_spin_lock_irqsave(&mp->lock, flags); 526 - mofld_update_bufcfg(mp, pin, bits, mask); 527 - raw_spin_unlock_irqrestore(&mp->lock, flags); 528 - 529 - return 0; 530 - } 531 - 532 - static const struct pinmux_ops mofld_pinmux_ops = { 533 - .get_functions_count = mofld_get_functions_count, 534 - .get_function_name = mofld_get_function_name, 535 - .get_function_groups = mofld_get_function_groups, 536 - .set_mux = mofld_pinmux_set_mux, 537 - .gpio_request_enable = mofld_gpio_request_enable, 538 - }; 539 - 540 - static int mofld_config_get(struct pinctrl_dev *pctldev, unsigned int pin, 541 - unsigned long *config) 542 - { 543 - struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 544 - enum pin_config_param param = pinconf_to_config_param(*config); 545 - u32 value, term; 546 - u16 arg = 0; 547 - int ret; 548 - 549 - ret = mofld_read_bufcfg(mp, pin, &value); 550 - if (ret) 551 - return -ENOTSUPP; 552 - 553 - term = (value & BUFCFG_PUPD_VAL_MASK) >> BUFCFG_PUPD_VAL_SHIFT; 554 - 555 - switch (param) { 556 - case PIN_CONFIG_BIAS_DISABLE: 557 - if (value & BUFCFG_Px_EN_MASK) 558 - return -EINVAL; 559 - break; 560 - 561 - case PIN_CONFIG_BIAS_PULL_UP: 562 - if ((value & BUFCFG_Px_EN_MASK) != BUFCFG_PU_EN) 563 - return -EINVAL; 564 - 565 - switch (term) { 566 - case BUFCFG_PUPD_VAL_910: 567 - arg = 910; 568 - break; 569 - case BUFCFG_PUPD_VAL_2K: 570 - arg = 2000; 571 - break; 572 - case BUFCFG_PUPD_VAL_20K: 573 - arg = 20000; 574 - break; 575 - case BUFCFG_PUPD_VAL_50K: 576 - arg = 50000; 577 - break; 578 - } 579 - 580 - break; 581 - 582 - case PIN_CONFIG_BIAS_PULL_DOWN: 583 - if ((value & BUFCFG_Px_EN_MASK) != BUFCFG_PD_EN) 584 - return -EINVAL; 585 - 586 - switch (term) { 587 - case BUFCFG_PUPD_VAL_910: 588 - arg = 910; 589 - break; 590 - case BUFCFG_PUPD_VAL_2K: 591 - arg = 2000; 592 - break; 593 - case BUFCFG_PUPD_VAL_20K: 594 - arg = 20000; 595 - break; 596 - case BUFCFG_PUPD_VAL_50K: 597 - arg = 50000; 598 - break; 599 - } 600 - 601 - break; 602 - 603 - case PIN_CONFIG_DRIVE_PUSH_PULL: 604 - if (value & BUFCFG_OD_EN) 605 - return -EINVAL; 606 - break; 607 - 608 - case PIN_CONFIG_DRIVE_OPEN_DRAIN: 609 - if (!(value & BUFCFG_OD_EN)) 610 - return -EINVAL; 611 - break; 612 - 613 - case PIN_CONFIG_SLEW_RATE: 614 - if (!(value & BUFCFG_SLEWSEL)) 615 - arg = 0; 616 - else 617 - arg = 1; 618 - break; 619 - 620 - default: 621 - return -ENOTSUPP; 622 - } 623 - 624 - *config = pinconf_to_config_packed(param, arg); 625 - return 0; 626 - } 627 - 628 - static int mofld_config_set_pin(struct mofld_pinctrl *mp, unsigned int pin, 629 - unsigned long config) 630 - { 631 - unsigned int param = pinconf_to_config_param(config); 632 - unsigned int arg = pinconf_to_config_argument(config); 633 - u32 bits = 0, mask = 0; 634 - unsigned long flags; 635 - 636 - switch (param) { 637 - case PIN_CONFIG_BIAS_DISABLE: 638 - mask |= BUFCFG_Px_EN_MASK | BUFCFG_PUPD_VAL_MASK; 639 - break; 640 - 641 - case PIN_CONFIG_BIAS_PULL_UP: 642 - mask |= BUFCFG_Px_EN_MASK | BUFCFG_PUPD_VAL_MASK; 643 - bits |= BUFCFG_PU_EN; 644 - 645 - switch (arg) { 646 - case 50000: 647 - bits |= BUFCFG_PUPD_VAL_50K << BUFCFG_PUPD_VAL_SHIFT; 648 - break; 649 - case 20000: 650 - bits |= BUFCFG_PUPD_VAL_20K << BUFCFG_PUPD_VAL_SHIFT; 651 - break; 652 - case 2000: 653 - bits |= BUFCFG_PUPD_VAL_2K << BUFCFG_PUPD_VAL_SHIFT; 654 - break; 655 - default: 656 - return -EINVAL; 657 - } 658 - 659 - break; 660 - 661 - case PIN_CONFIG_BIAS_PULL_DOWN: 662 - mask |= BUFCFG_Px_EN_MASK | BUFCFG_PUPD_VAL_MASK; 663 - bits |= BUFCFG_PD_EN; 664 - 665 - switch (arg) { 666 - case 50000: 667 - bits |= BUFCFG_PUPD_VAL_50K << BUFCFG_PUPD_VAL_SHIFT; 668 - break; 669 - case 20000: 670 - bits |= BUFCFG_PUPD_VAL_20K << BUFCFG_PUPD_VAL_SHIFT; 671 - break; 672 - case 2000: 673 - bits |= BUFCFG_PUPD_VAL_2K << BUFCFG_PUPD_VAL_SHIFT; 674 - break; 675 - default: 676 - return -EINVAL; 677 - } 678 - 679 - break; 680 - 681 - case PIN_CONFIG_DRIVE_PUSH_PULL: 682 - mask |= BUFCFG_OD_EN; 683 - bits &= ~BUFCFG_OD_EN; 684 - break; 685 - 686 - case PIN_CONFIG_DRIVE_OPEN_DRAIN: 687 - mask |= BUFCFG_OD_EN; 688 - bits |= BUFCFG_OD_EN; 689 - break; 690 - 691 - case PIN_CONFIG_SLEW_RATE: 692 - mask |= BUFCFG_SLEWSEL; 693 - if (arg) 694 - bits |= BUFCFG_SLEWSEL; 695 - break; 696 - } 697 - 698 - raw_spin_lock_irqsave(&mp->lock, flags); 699 - mofld_update_bufcfg(mp, pin, bits, mask); 700 - raw_spin_unlock_irqrestore(&mp->lock, flags); 701 - 702 - return 0; 703 - } 704 - 705 - static int mofld_config_set(struct pinctrl_dev *pctldev, unsigned int pin, 706 - unsigned long *configs, unsigned int nconfigs) 707 - { 708 - struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 709 - unsigned int i; 710 - int ret; 711 - 712 - if (!mofld_buf_available(mp, pin)) 713 - return -ENOTSUPP; 714 - 715 - for (i = 0; i < nconfigs; i++) { 716 - switch (pinconf_to_config_param(configs[i])) { 717 - case PIN_CONFIG_BIAS_DISABLE: 718 - case PIN_CONFIG_BIAS_PULL_UP: 719 - case PIN_CONFIG_BIAS_PULL_DOWN: 720 - case PIN_CONFIG_DRIVE_PUSH_PULL: 721 - case PIN_CONFIG_DRIVE_OPEN_DRAIN: 722 - case PIN_CONFIG_SLEW_RATE: 723 - ret = mofld_config_set_pin(mp, pin, configs[i]); 724 - if (ret) 725 - return ret; 726 - break; 727 - 728 - default: 729 - return -ENOTSUPP; 730 - } 731 - } 732 - 733 - return 0; 734 - } 735 - 736 - static int mofld_config_group_get(struct pinctrl_dev *pctldev, unsigned int group, 737 - unsigned long *config) 738 - { 739 - const unsigned int *pins; 740 - unsigned int npins; 741 - int ret; 742 - 743 - ret = mofld_get_group_pins(pctldev, group, &pins, &npins); 744 - if (ret) 745 - return ret; 746 - 747 - ret = mofld_config_get(pctldev, pins[0], config); 748 - if (ret) 749 - return ret; 750 - 751 - return 0; 752 - } 753 - 754 - static int mofld_config_group_set(struct pinctrl_dev *pctldev, unsigned int group, 755 - unsigned long *configs, unsigned int num_configs) 756 - { 757 - const unsigned int *pins; 758 - unsigned int npins; 759 - int i, ret; 760 - 761 - ret = mofld_get_group_pins(pctldev, group, &pins, &npins); 762 - if (ret) 763 - return ret; 764 - 765 - for (i = 0; i < npins; i++) { 766 - ret = mofld_config_set(pctldev, pins[i], configs, num_configs); 767 - if (ret) 768 - return ret; 769 - } 770 - 771 - return 0; 772 - } 773 - 774 - static const struct pinconf_ops mofld_pinconf_ops = { 775 - .is_generic = true, 776 - .pin_config_get = mofld_config_get, 777 - .pin_config_set = mofld_config_set, 778 - .pin_config_group_get = mofld_config_group_get, 779 - .pin_config_group_set = mofld_config_group_set, 780 - }; 781 - 782 - static const struct pinctrl_desc mofld_pinctrl_desc = { 783 - .pctlops = &mofld_pinctrl_ops, 784 - .pmxops = &mofld_pinmux_ops, 785 - .confops = &mofld_pinconf_ops, 786 - .owner = THIS_MODULE, 787 - }; 788 - 789 - static int mofld_pinctrl_probe(struct platform_device *pdev) 790 - { 791 - struct device *dev = &pdev->dev; 792 - struct mofld_family *families; 793 - struct mofld_pinctrl *mp; 794 - void __iomem *regs; 795 - size_t nfamilies; 796 - unsigned int i; 797 - 798 - mp = devm_kzalloc(dev, sizeof(*mp), GFP_KERNEL); 799 - if (!mp) 800 - return -ENOMEM; 801 - 802 - mp->dev = dev; 803 - raw_spin_lock_init(&mp->lock); 804 - 805 - regs = devm_platform_ioremap_resource(pdev, 0); 806 - if (IS_ERR(regs)) 807 - return PTR_ERR(regs); 808 - 809 - nfamilies = ARRAY_SIZE(mofld_families), 810 - families = devm_kmemdup(dev, mofld_families, sizeof(mofld_families), GFP_KERNEL); 811 - if (!families) 812 - return -ENOMEM; 813 - 814 - /* Splice memory resource by chunk per family */ 815 - for (i = 0; i < nfamilies; i++) { 816 - struct mofld_family *family = &families[i]; 817 - 818 - family->regs = regs + family->barno * MOFLD_FAMILY_LEN; 819 - } 820 - 821 - mp->families = families; 822 - mp->nfamilies = nfamilies; 823 - mp->pctldesc = mofld_pinctrl_desc; 824 - mp->pctldesc.name = dev_name(dev); 825 - mp->pctldesc.pins = mofld_pins; 826 - mp->pctldesc.npins = ARRAY_SIZE(mofld_pins); 827 - 828 - mp->pctldev = devm_pinctrl_register(dev, &mp->pctldesc, mp); 829 - if (IS_ERR(mp->pctldev)) 830 - return PTR_ERR(mp->pctldev); 831 - 832 - platform_set_drvdata(pdev, mp); 833 - return 0; 834 - } 835 374 836 375 static const struct acpi_device_id mofld_acpi_table[] = { 837 - { "INTC1003" }, 376 + { "INTC1003", (kernel_ulong_t)&mofld_soc_data }, 838 377 { } 839 378 }; 840 379 MODULE_DEVICE_TABLE(acpi, mofld_acpi_table); 841 380 842 381 static struct platform_driver mofld_pinctrl_driver = { 843 - .probe = mofld_pinctrl_probe, 382 + .probe = devm_tng_pinctrl_probe, 844 383 .driver = { 845 384 .name = "pinctrl-moorefield", 846 385 .acpi_match_table = mofld_acpi_table, ··· 341 924 MODULE_DESCRIPTION("Intel Moorefield SoC pinctrl driver"); 342 925 MODULE_LICENSE("GPL v2"); 343 926 MODULE_ALIAS("platform:pinctrl-moorefield"); 927 + MODULE_IMPORT_NS(PINCTRL_TANGIER);
+1
drivers/pinctrl/intel/pinctrl-sunrisepoint.c
··· 606 606 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); 607 607 MODULE_DESCRIPTION("Intel Sunrisepoint PCH pinctrl/GPIO driver"); 608 608 MODULE_LICENSE("GPL v2"); 609 + MODULE_IMPORT_NS(PINCTRL_INTEL);
+589
drivers/pinctrl/intel/pinctrl-tangier.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Intel Tangier pinctrl driver 4 + * 5 + * Copyright (C) 2016, 2023 Intel Corporation 6 + * 7 + * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 8 + * Raag Jadav <raag.jadav@intel.com> 9 + */ 10 + 11 + #include <linux/bits.h> 12 + #include <linux/device.h> 13 + #include <linux/err.h> 14 + #include <linux/errno.h> 15 + #include <linux/export.h> 16 + #include <linux/io.h> 17 + #include <linux/module.h> 18 + #include <linux/overflow.h> 19 + #include <linux/platform_device.h> 20 + #include <linux/property.h> 21 + #include <linux/seq_file.h> 22 + #include <linux/spinlock.h> 23 + #include <linux/types.h> 24 + 25 + #include <linux/pinctrl/pinconf-generic.h> 26 + #include <linux/pinctrl/pinconf.h> 27 + #include <linux/pinctrl/pinctrl.h> 28 + #include <linux/pinctrl/pinmux.h> 29 + 30 + #include "../core.h" 31 + #include "pinctrl-intel.h" 32 + #include "pinctrl-tangier.h" 33 + 34 + #define SLEW_OFFSET 0x000 35 + #define BUFCFG_OFFSET 0x100 36 + #define MISC_OFFSET 0x300 37 + 38 + #define BUFCFG_PINMODE_SHIFT 0 39 + #define BUFCFG_PINMODE_MASK GENMASK(2, 0) 40 + #define BUFCFG_PINMODE_GPIO 0 41 + #define BUFCFG_PUPD_VAL_SHIFT 4 42 + #define BUFCFG_PUPD_VAL_MASK GENMASK(5, 4) 43 + #define BUFCFG_PUPD_VAL_2K 0 44 + #define BUFCFG_PUPD_VAL_20K 1 45 + #define BUFCFG_PUPD_VAL_50K 2 46 + #define BUFCFG_PUPD_VAL_910 3 47 + #define BUFCFG_PU_EN BIT(8) 48 + #define BUFCFG_PD_EN BIT(9) 49 + #define BUFCFG_Px_EN_MASK GENMASK(9, 8) 50 + #define BUFCFG_SLEWSEL BIT(10) 51 + #define BUFCFG_OVINEN BIT(12) 52 + #define BUFCFG_OVINEN_EN BIT(13) 53 + #define BUFCFG_OVINEN_MASK GENMASK(13, 12) 54 + #define BUFCFG_OVOUTEN BIT(14) 55 + #define BUFCFG_OVOUTEN_EN BIT(15) 56 + #define BUFCFG_OVOUTEN_MASK GENMASK(15, 14) 57 + #define BUFCFG_INDATAOV_VAL BIT(16) 58 + #define BUFCFG_INDATAOV_EN BIT(17) 59 + #define BUFCFG_INDATAOV_MASK GENMASK(17, 16) 60 + #define BUFCFG_OUTDATAOV_VAL BIT(18) 61 + #define BUFCFG_OUTDATAOV_EN BIT(19) 62 + #define BUFCFG_OUTDATAOV_MASK GENMASK(19, 18) 63 + #define BUFCFG_OD_EN BIT(21) 64 + 65 + #define pin_to_bufno(f, p) ((p) - (f)->pin_base) 66 + 67 + static const struct tng_family *tng_get_family(struct tng_pinctrl *tp, 68 + unsigned int pin) 69 + { 70 + const struct tng_family *family; 71 + unsigned int i; 72 + 73 + for (i = 0; i < tp->nfamilies; i++) { 74 + family = &tp->families[i]; 75 + if (pin >= family->pin_base && 76 + pin < family->pin_base + family->npins) 77 + return family; 78 + } 79 + 80 + dev_warn(tp->dev, "failed to find family for pin %u\n", pin); 81 + return NULL; 82 + } 83 + 84 + static bool tng_buf_available(struct tng_pinctrl *tp, unsigned int pin) 85 + { 86 + const struct tng_family *family; 87 + 88 + family = tng_get_family(tp, pin); 89 + if (!family) 90 + return false; 91 + 92 + return !family->protected; 93 + } 94 + 95 + static void __iomem *tng_get_bufcfg(struct tng_pinctrl *tp, unsigned int pin) 96 + { 97 + const struct tng_family *family; 98 + unsigned int bufno; 99 + 100 + family = tng_get_family(tp, pin); 101 + if (!family) 102 + return NULL; 103 + 104 + bufno = pin_to_bufno(family, pin); 105 + return family->regs + BUFCFG_OFFSET + bufno * 4; 106 + } 107 + 108 + static int tng_read_bufcfg(struct tng_pinctrl *tp, unsigned int pin, u32 *value) 109 + { 110 + void __iomem *bufcfg; 111 + 112 + if (!tng_buf_available(tp, pin)) 113 + return -EBUSY; 114 + 115 + bufcfg = tng_get_bufcfg(tp, pin); 116 + *value = readl(bufcfg); 117 + 118 + return 0; 119 + } 120 + 121 + static void tng_update_bufcfg(struct tng_pinctrl *tp, unsigned int pin, 122 + u32 bits, u32 mask) 123 + { 124 + void __iomem *bufcfg; 125 + u32 value; 126 + 127 + bufcfg = tng_get_bufcfg(tp, pin); 128 + 129 + value = readl(bufcfg); 130 + value = (value & ~mask) | (bits & mask); 131 + writel(value, bufcfg); 132 + } 133 + 134 + static int tng_get_groups_count(struct pinctrl_dev *pctldev) 135 + { 136 + struct tng_pinctrl *tp = pinctrl_dev_get_drvdata(pctldev); 137 + 138 + return tp->ngroups; 139 + } 140 + 141 + static const char *tng_get_group_name(struct pinctrl_dev *pctldev, 142 + unsigned int group) 143 + { 144 + struct tng_pinctrl *tp = pinctrl_dev_get_drvdata(pctldev); 145 + 146 + return tp->groups[group].grp.name; 147 + } 148 + 149 + static int tng_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, 150 + const unsigned int **pins, unsigned int *npins) 151 + { 152 + struct tng_pinctrl *tp = pinctrl_dev_get_drvdata(pctldev); 153 + 154 + *pins = tp->groups[group].grp.pins; 155 + *npins = tp->groups[group].grp.npins; 156 + return 0; 157 + } 158 + 159 + static void tng_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, 160 + unsigned int pin) 161 + { 162 + struct tng_pinctrl *tp = pinctrl_dev_get_drvdata(pctldev); 163 + u32 value, mode; 164 + int ret; 165 + 166 + ret = tng_read_bufcfg(tp, pin, &value); 167 + if (ret) { 168 + seq_puts(s, "not available"); 169 + return; 170 + } 171 + 172 + mode = (value & BUFCFG_PINMODE_MASK) >> BUFCFG_PINMODE_SHIFT; 173 + if (mode == BUFCFG_PINMODE_GPIO) 174 + seq_puts(s, "GPIO "); 175 + else 176 + seq_printf(s, "mode %d ", mode); 177 + 178 + seq_printf(s, "0x%08x", value); 179 + } 180 + 181 + static const struct pinctrl_ops tng_pinctrl_ops = { 182 + .get_groups_count = tng_get_groups_count, 183 + .get_group_name = tng_get_group_name, 184 + .get_group_pins = tng_get_group_pins, 185 + .pin_dbg_show = tng_pin_dbg_show, 186 + }; 187 + 188 + static int tng_get_functions_count(struct pinctrl_dev *pctldev) 189 + { 190 + struct tng_pinctrl *tp = pinctrl_dev_get_drvdata(pctldev); 191 + 192 + return tp->nfunctions; 193 + } 194 + 195 + static const char *tng_get_function_name(struct pinctrl_dev *pctldev, 196 + unsigned int function) 197 + { 198 + struct tng_pinctrl *tp = pinctrl_dev_get_drvdata(pctldev); 199 + 200 + return tp->functions[function].func.name; 201 + } 202 + 203 + static int tng_get_function_groups(struct pinctrl_dev *pctldev, 204 + unsigned int function, 205 + const char * const **groups, 206 + unsigned int * const ngroups) 207 + { 208 + struct tng_pinctrl *tp = pinctrl_dev_get_drvdata(pctldev); 209 + 210 + *groups = tp->functions[function].func.groups; 211 + *ngroups = tp->functions[function].func.ngroups; 212 + return 0; 213 + } 214 + 215 + static int tng_pinmux_set_mux(struct pinctrl_dev *pctldev, 216 + unsigned int function, 217 + unsigned int group) 218 + { 219 + struct tng_pinctrl *tp = pinctrl_dev_get_drvdata(pctldev); 220 + const struct intel_pingroup *grp = &tp->groups[group]; 221 + u32 bits = grp->mode << BUFCFG_PINMODE_SHIFT; 222 + u32 mask = BUFCFG_PINMODE_MASK; 223 + unsigned long flags; 224 + unsigned int i; 225 + 226 + /* 227 + * All pins in the groups needs to be accessible and writable 228 + * before we can enable the mux for this group. 229 + */ 230 + for (i = 0; i < grp->grp.npins; i++) { 231 + if (!tng_buf_available(tp, grp->grp.pins[i])) 232 + return -EBUSY; 233 + } 234 + 235 + /* Now enable the mux setting for each pin in the group */ 236 + raw_spin_lock_irqsave(&tp->lock, flags); 237 + for (i = 0; i < grp->grp.npins; i++) 238 + tng_update_bufcfg(tp, grp->grp.pins[i], bits, mask); 239 + raw_spin_unlock_irqrestore(&tp->lock, flags); 240 + 241 + return 0; 242 + } 243 + 244 + static int tng_gpio_request_enable(struct pinctrl_dev *pctldev, 245 + struct pinctrl_gpio_range *range, 246 + unsigned int pin) 247 + { 248 + struct tng_pinctrl *tp = pinctrl_dev_get_drvdata(pctldev); 249 + u32 bits = BUFCFG_PINMODE_GPIO << BUFCFG_PINMODE_SHIFT; 250 + u32 mask = BUFCFG_PINMODE_MASK; 251 + unsigned long flags; 252 + 253 + if (!tng_buf_available(tp, pin)) 254 + return -EBUSY; 255 + 256 + raw_spin_lock_irqsave(&tp->lock, flags); 257 + tng_update_bufcfg(tp, pin, bits, mask); 258 + raw_spin_unlock_irqrestore(&tp->lock, flags); 259 + 260 + return 0; 261 + } 262 + 263 + static const struct pinmux_ops tng_pinmux_ops = { 264 + .get_functions_count = tng_get_functions_count, 265 + .get_function_name = tng_get_function_name, 266 + .get_function_groups = tng_get_function_groups, 267 + .set_mux = tng_pinmux_set_mux, 268 + .gpio_request_enable = tng_gpio_request_enable, 269 + }; 270 + 271 + static int tng_config_get(struct pinctrl_dev *pctldev, unsigned int pin, 272 + unsigned long *config) 273 + { 274 + struct tng_pinctrl *tp = pinctrl_dev_get_drvdata(pctldev); 275 + enum pin_config_param param = pinconf_to_config_param(*config); 276 + u32 value, term; 277 + u16 arg = 0; 278 + int ret; 279 + 280 + ret = tng_read_bufcfg(tp, pin, &value); 281 + if (ret) 282 + return -ENOTSUPP; 283 + 284 + term = (value & BUFCFG_PUPD_VAL_MASK) >> BUFCFG_PUPD_VAL_SHIFT; 285 + 286 + switch (param) { 287 + case PIN_CONFIG_BIAS_DISABLE: 288 + if (value & BUFCFG_Px_EN_MASK) 289 + return -EINVAL; 290 + break; 291 + 292 + case PIN_CONFIG_BIAS_PULL_UP: 293 + if ((value & BUFCFG_Px_EN_MASK) != BUFCFG_PU_EN) 294 + return -EINVAL; 295 + 296 + switch (term) { 297 + case BUFCFG_PUPD_VAL_910: 298 + arg = 910; 299 + break; 300 + case BUFCFG_PUPD_VAL_2K: 301 + arg = 2000; 302 + break; 303 + case BUFCFG_PUPD_VAL_20K: 304 + arg = 20000; 305 + break; 306 + case BUFCFG_PUPD_VAL_50K: 307 + arg = 50000; 308 + break; 309 + } 310 + 311 + break; 312 + 313 + case PIN_CONFIG_BIAS_PULL_DOWN: 314 + if ((value & BUFCFG_Px_EN_MASK) != BUFCFG_PD_EN) 315 + return -EINVAL; 316 + 317 + switch (term) { 318 + case BUFCFG_PUPD_VAL_910: 319 + arg = 910; 320 + break; 321 + case BUFCFG_PUPD_VAL_2K: 322 + arg = 2000; 323 + break; 324 + case BUFCFG_PUPD_VAL_20K: 325 + arg = 20000; 326 + break; 327 + case BUFCFG_PUPD_VAL_50K: 328 + arg = 50000; 329 + break; 330 + } 331 + 332 + break; 333 + 334 + case PIN_CONFIG_DRIVE_PUSH_PULL: 335 + if (value & BUFCFG_OD_EN) 336 + return -EINVAL; 337 + break; 338 + 339 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 340 + if (!(value & BUFCFG_OD_EN)) 341 + return -EINVAL; 342 + break; 343 + 344 + case PIN_CONFIG_SLEW_RATE: 345 + if (value & BUFCFG_SLEWSEL) 346 + arg = 1; 347 + break; 348 + 349 + default: 350 + return -ENOTSUPP; 351 + } 352 + 353 + *config = pinconf_to_config_packed(param, arg); 354 + return 0; 355 + } 356 + 357 + static int tng_config_set_pin(struct tng_pinctrl *tp, unsigned int pin, 358 + unsigned long config) 359 + { 360 + unsigned int param = pinconf_to_config_param(config); 361 + unsigned int arg = pinconf_to_config_argument(config); 362 + u32 mask, term, value = 0; 363 + unsigned long flags; 364 + 365 + switch (param) { 366 + case PIN_CONFIG_BIAS_DISABLE: 367 + mask = BUFCFG_Px_EN_MASK | BUFCFG_PUPD_VAL_MASK; 368 + break; 369 + 370 + case PIN_CONFIG_BIAS_PULL_UP: 371 + /* Set default strength value in case none is given */ 372 + if (arg == 1) 373 + arg = 20000; 374 + 375 + switch (arg) { 376 + case 50000: 377 + term = BUFCFG_PUPD_VAL_50K; 378 + break; 379 + case 20000: 380 + term = BUFCFG_PUPD_VAL_20K; 381 + break; 382 + case 2000: 383 + term = BUFCFG_PUPD_VAL_2K; 384 + break; 385 + default: 386 + return -EINVAL; 387 + } 388 + 389 + mask = BUFCFG_Px_EN_MASK | BUFCFG_PUPD_VAL_MASK; 390 + value = BUFCFG_PU_EN | (term << BUFCFG_PUPD_VAL_SHIFT); 391 + break; 392 + 393 + case PIN_CONFIG_BIAS_PULL_DOWN: 394 + /* Set default strength value in case none is given */ 395 + if (arg == 1) 396 + arg = 20000; 397 + 398 + switch (arg) { 399 + case 50000: 400 + term = BUFCFG_PUPD_VAL_50K; 401 + break; 402 + case 20000: 403 + term = BUFCFG_PUPD_VAL_20K; 404 + break; 405 + case 2000: 406 + term = BUFCFG_PUPD_VAL_2K; 407 + break; 408 + default: 409 + return -EINVAL; 410 + } 411 + 412 + mask = BUFCFG_Px_EN_MASK | BUFCFG_PUPD_VAL_MASK; 413 + value = BUFCFG_PD_EN | (term << BUFCFG_PUPD_VAL_SHIFT); 414 + break; 415 + 416 + case PIN_CONFIG_DRIVE_PUSH_PULL: 417 + mask = BUFCFG_OD_EN; 418 + break; 419 + 420 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 421 + mask = BUFCFG_OD_EN; 422 + value = BUFCFG_OD_EN; 423 + break; 424 + 425 + case PIN_CONFIG_SLEW_RATE: 426 + mask = BUFCFG_SLEWSEL; 427 + if (arg) 428 + value = BUFCFG_SLEWSEL; 429 + break; 430 + 431 + default: 432 + return -EINVAL; 433 + } 434 + 435 + raw_spin_lock_irqsave(&tp->lock, flags); 436 + tng_update_bufcfg(tp, pin, value, mask); 437 + raw_spin_unlock_irqrestore(&tp->lock, flags); 438 + 439 + return 0; 440 + } 441 + 442 + static int tng_config_set(struct pinctrl_dev *pctldev, unsigned int pin, 443 + unsigned long *configs, unsigned int nconfigs) 444 + { 445 + struct tng_pinctrl *tp = pinctrl_dev_get_drvdata(pctldev); 446 + unsigned int i; 447 + int ret; 448 + 449 + if (!tng_buf_available(tp, pin)) 450 + return -ENOTSUPP; 451 + 452 + for (i = 0; i < nconfigs; i++) { 453 + switch (pinconf_to_config_param(configs[i])) { 454 + case PIN_CONFIG_BIAS_DISABLE: 455 + case PIN_CONFIG_BIAS_PULL_UP: 456 + case PIN_CONFIG_BIAS_PULL_DOWN: 457 + case PIN_CONFIG_DRIVE_PUSH_PULL: 458 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 459 + case PIN_CONFIG_SLEW_RATE: 460 + ret = tng_config_set_pin(tp, pin, configs[i]); 461 + if (ret) 462 + return ret; 463 + break; 464 + 465 + default: 466 + return -ENOTSUPP; 467 + } 468 + } 469 + 470 + return 0; 471 + } 472 + 473 + static int tng_config_group_get(struct pinctrl_dev *pctldev, 474 + unsigned int group, unsigned long *config) 475 + { 476 + const unsigned int *pins; 477 + unsigned int npins; 478 + int ret; 479 + 480 + ret = tng_get_group_pins(pctldev, group, &pins, &npins); 481 + if (ret) 482 + return ret; 483 + 484 + return tng_config_get(pctldev, pins[0], config); 485 + } 486 + 487 + static int tng_config_group_set(struct pinctrl_dev *pctldev, 488 + unsigned int group, unsigned long *configs, 489 + unsigned int num_configs) 490 + { 491 + const unsigned int *pins; 492 + unsigned int npins; 493 + int i, ret; 494 + 495 + ret = tng_get_group_pins(pctldev, group, &pins, &npins); 496 + if (ret) 497 + return ret; 498 + 499 + for (i = 0; i < npins; i++) { 500 + ret = tng_config_set(pctldev, pins[i], configs, num_configs); 501 + if (ret) 502 + return ret; 503 + } 504 + 505 + return 0; 506 + } 507 + 508 + static const struct pinconf_ops tng_pinconf_ops = { 509 + .is_generic = true, 510 + .pin_config_get = tng_config_get, 511 + .pin_config_set = tng_config_set, 512 + .pin_config_group_get = tng_config_group_get, 513 + .pin_config_group_set = tng_config_group_set, 514 + }; 515 + 516 + static const struct pinctrl_desc tng_pinctrl_desc = { 517 + .pctlops = &tng_pinctrl_ops, 518 + .pmxops = &tng_pinmux_ops, 519 + .confops = &tng_pinconf_ops, 520 + .owner = THIS_MODULE, 521 + }; 522 + 523 + static int tng_pinctrl_probe(struct platform_device *pdev, 524 + const struct tng_pinctrl *data) 525 + { 526 + struct device *dev = &pdev->dev; 527 + struct tng_family *families; 528 + struct tng_pinctrl *tp; 529 + size_t families_len; 530 + void __iomem *regs; 531 + unsigned int i; 532 + 533 + tp = devm_kmemdup(dev, data, sizeof(*data), GFP_KERNEL); 534 + if (!tp) 535 + return -ENOMEM; 536 + 537 + tp->dev = dev; 538 + raw_spin_lock_init(&tp->lock); 539 + 540 + regs = devm_platform_ioremap_resource(pdev, 0); 541 + if (IS_ERR(regs)) 542 + return PTR_ERR(regs); 543 + 544 + /* 545 + * Make a copy of the families which we can use to hold pointers 546 + * to the registers. 547 + */ 548 + families_len = size_mul(sizeof(*families), tp->nfamilies); 549 + families = devm_kmemdup(dev, tp->families, families_len, GFP_KERNEL); 550 + if (!families) 551 + return -ENOMEM; 552 + 553 + /* Splice memory resource by chunk per family */ 554 + for (i = 0; i < tp->nfamilies; i++) { 555 + struct tng_family *family = &families[i]; 556 + 557 + family->regs = regs + family->barno * TNG_FAMILY_LEN; 558 + } 559 + 560 + tp->families = families; 561 + tp->pctldesc = tng_pinctrl_desc; 562 + tp->pctldesc.name = dev_name(dev); 563 + tp->pctldesc.pins = tp->pins; 564 + tp->pctldesc.npins = tp->npins; 565 + 566 + tp->pctldev = devm_pinctrl_register(dev, &tp->pctldesc, tp); 567 + if (IS_ERR(tp->pctldev)) 568 + return dev_err_probe(dev, PTR_ERR(tp->pctldev), 569 + "failed to register pinctrl driver\n"); 570 + 571 + return 0; 572 + } 573 + 574 + int devm_tng_pinctrl_probe(struct platform_device *pdev) 575 + { 576 + const struct tng_pinctrl *data; 577 + 578 + data = device_get_match_data(&pdev->dev); 579 + if (!data) 580 + return -ENODATA; 581 + 582 + return tng_pinctrl_probe(pdev, data); 583 + } 584 + EXPORT_SYMBOL_NS_GPL(devm_tng_pinctrl_probe, PINCTRL_TANGIER); 585 + 586 + MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>"); 587 + MODULE_AUTHOR("Raag Jadav <raag.jadav@intel.com>"); 588 + MODULE_DESCRIPTION("Intel Tangier pinctrl driver"); 589 + MODULE_LICENSE("GPL");
+92
drivers/pinctrl/intel/pinctrl-tangier.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + /* 3 + * Intel Tangier pinctrl functions 4 + * 5 + * Copyright (C) 2016, 2023 Intel Corporation 6 + * 7 + * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 8 + * Raag Jadav <raag.jadav@intel.com> 9 + */ 10 + 11 + #ifndef PINCTRL_TANGIER_H 12 + #define PINCTRL_TANGIER_H 13 + 14 + #include <linux/spinlock_types.h> 15 + #include <linux/types.h> 16 + 17 + #include <linux/pinctrl/pinctrl.h> 18 + 19 + #include "pinctrl-intel.h" 20 + 21 + struct device; 22 + struct platform_device; 23 + 24 + #define TNG_FAMILY_NR 64 25 + #define TNG_FAMILY_LEN 0x400 26 + 27 + /** 28 + * struct tng_family - Tangier pin family description 29 + * @barno: MMIO BAR number where registers for this family reside 30 + * @pin_base: Starting pin of pins in this family 31 + * @npins: Number of pins in this family 32 + * @protected: True if family is protected by access 33 + * @regs: Family specific common registers 34 + */ 35 + struct tng_family { 36 + unsigned int barno; 37 + unsigned int pin_base; 38 + size_t npins; 39 + bool protected; 40 + void __iomem *regs; 41 + }; 42 + 43 + #define TNG_FAMILY(b, s, e) \ 44 + { \ 45 + .barno = (b), \ 46 + .pin_base = (s), \ 47 + .npins = (e) - (s) + 1, \ 48 + } 49 + 50 + #define TNG_FAMILY_PROTECTED(b, s, e) \ 51 + { \ 52 + .barno = (b), \ 53 + .pin_base = (s), \ 54 + .npins = (e) - (s) + 1, \ 55 + .protected = true, \ 56 + } 57 + 58 + /** 59 + * struct tng_pinctrl - Tangier pinctrl private structure 60 + * @dev: Pointer to the device structure 61 + * @lock: Lock to serialize register access 62 + * @pctldesc: Pin controller description 63 + * @pctldev: Pointer to the pin controller device 64 + * @families: Array of families this pinctrl handles 65 + * @nfamilies: Number of families in the array 66 + * @functions: Array of functions 67 + * @nfunctions: Number of functions in the array 68 + * @groups: Array of pin groups 69 + * @ngroups: Number of groups in the array 70 + * @pins: Array of pins this pinctrl controls 71 + * @npins: Number of pins in the array 72 + */ 73 + struct tng_pinctrl { 74 + struct device *dev; 75 + raw_spinlock_t lock; 76 + struct pinctrl_desc pctldesc; 77 + struct pinctrl_dev *pctldev; 78 + 79 + /* Pin controller configuration */ 80 + const struct tng_family *families; 81 + size_t nfamilies; 82 + const struct intel_function *functions; 83 + size_t nfunctions; 84 + const struct intel_pingroup *groups; 85 + size_t ngroups; 86 + const struct pinctrl_pin_desc *pins; 87 + size_t npins; 88 + }; 89 + 90 + int devm_tng_pinctrl_probe(struct platform_device *pdev); 91 + 92 + #endif /* PINCTRL_TANGIER_H */
+1 -1
drivers/pinctrl/intel/pinctrl-tigerlake.c
··· 753 753 .pm = &tgl_pinctrl_pm_ops, 754 754 }, 755 755 }; 756 - 757 756 module_platform_driver(tgl_pinctrl_driver); 758 757 759 758 MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>"); 760 759 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); 761 760 MODULE_DESCRIPTION("Intel Tiger Lake PCH pinctrl/GPIO driver"); 762 761 MODULE_LICENSE("GPL v2"); 762 + MODULE_IMPORT_NS(PINCTRL_INTEL);
-1
drivers/pinctrl/mediatek/pinctrl-mt2701.c
··· 7 7 #include <dt-bindings/pinctrl/mt65xx.h> 8 8 #include <linux/module.h> 9 9 #include <linux/of.h> 10 - #include <linux/of_device.h> 11 10 #include <linux/platform_device.h> 12 11 #include <linux/pinctrl/pinctrl.h> 13 12 #include <linux/regmap.h>
-1
drivers/pinctrl/mediatek/pinctrl-mt2712.c
··· 8 8 #include <linux/module.h> 9 9 #include <linux/platform_device.h> 10 10 #include <linux/of.h> 11 - #include <linux/of_device.h> 12 11 #include <linux/pinctrl/pinctrl.h> 13 12 #include <linux/regmap.h> 14 13 #include <linux/pinctrl/pinconf-generic.h>
-1
drivers/pinctrl/mediatek/pinctrl-mt6397.c
··· 7 7 #include <linux/init.h> 8 8 #include <linux/platform_device.h> 9 9 #include <linux/of.h> 10 - #include <linux/of_device.h> 11 10 #include <linux/pinctrl/pinctrl.h> 12 11 #include <linux/pinctrl/pinconf-generic.h> 13 12 #include <linux/mfd/mt6397/core.h>
+13 -31
drivers/pinctrl/mediatek/pinctrl-mt7981.c
··· 457 457 MTK_PULL_PUPD_R1R0_TYPE,/*34*/ MTK_PULL_PUPD_R1R0_TYPE,/*35*/ 458 458 MTK_PULL_PUPD_R1R0_TYPE,/*36*/ MTK_PULL_PUPD_R1R0_TYPE,/*37*/ 459 459 MTK_PULL_PUPD_R1R0_TYPE,/*38*/ MTK_PULL_PUPD_R1R0_TYPE,/*39*/ 460 - MTK_PULL_PUPD_R1R0_TYPE,/*40*/ MTK_PULL_PUPD_R1R0_TYPE,/*41*/ 461 - MTK_PULL_PUPD_R1R0_TYPE,/*42*/ MTK_PULL_PUPD_R1R0_TYPE,/*43*/ 462 - MTK_PULL_PUPD_R1R0_TYPE,/*44*/ MTK_PULL_PUPD_R1R0_TYPE,/*45*/ 463 - MTK_PULL_PUPD_R1R0_TYPE,/*46*/ MTK_PULL_PUPD_R1R0_TYPE,/*47*/ 464 - MTK_PULL_PUPD_R1R0_TYPE,/*48*/ MTK_PULL_PUPD_R1R0_TYPE,/*49*/ 465 - MTK_PULL_PUPD_R1R0_TYPE,/*50*/ MTK_PULL_PUPD_R1R0_TYPE,/*51*/ 466 - MTK_PULL_PUPD_R1R0_TYPE,/*52*/ MTK_PULL_PUPD_R1R0_TYPE,/*53*/ 467 - MTK_PULL_PUPD_R1R0_TYPE,/*54*/ MTK_PULL_PUPD_R1R0_TYPE,/*55*/ 468 - MTK_PULL_PUPD_R1R0_TYPE,/*56*/ MTK_PULL_PUPD_R1R0_TYPE,/*57*/ 469 - MTK_PULL_PUPD_R1R0_TYPE,/*58*/ MTK_PULL_PUPD_R1R0_TYPE,/*59*/ 470 - MTK_PULL_PUPD_R1R0_TYPE,/*60*/ MTK_PULL_PUPD_R1R0_TYPE,/*61*/ 471 - MTK_PULL_PUPD_R1R0_TYPE,/*62*/ MTK_PULL_PUPD_R1R0_TYPE,/*63*/ 472 - MTK_PULL_PUPD_R1R0_TYPE,/*64*/ MTK_PULL_PUPD_R1R0_TYPE,/*65*/ 473 - MTK_PULL_PUPD_R1R0_TYPE,/*66*/ MTK_PULL_PUPD_R1R0_TYPE,/*67*/ 474 - MTK_PULL_PUPD_R1R0_TYPE,/*68*/ MTK_PULL_PU_PD_TYPE,/*69*/ 475 - MTK_PULL_PU_PD_TYPE,/*70*/ MTK_PULL_PU_PD_TYPE,/*71*/ 476 - MTK_PULL_PU_PD_TYPE,/*72*/ MTK_PULL_PU_PD_TYPE,/*73*/ 477 - MTK_PULL_PU_PD_TYPE,/*74*/ MTK_PULL_PU_PD_TYPE,/*75*/ 478 - MTK_PULL_PU_PD_TYPE,/*76*/ MTK_PULL_PU_PD_TYPE,/*77*/ 479 - MTK_PULL_PU_PD_TYPE,/*78*/ MTK_PULL_PU_PD_TYPE,/*79*/ 480 - MTK_PULL_PU_PD_TYPE,/*80*/ MTK_PULL_PU_PD_TYPE,/*81*/ 481 - MTK_PULL_PU_PD_TYPE,/*82*/ MTK_PULL_PU_PD_TYPE,/*83*/ 482 - MTK_PULL_PU_PD_TYPE,/*84*/ MTK_PULL_PU_PD_TYPE,/*85*/ 483 - MTK_PULL_PU_PD_TYPE,/*86*/ MTK_PULL_PU_PD_TYPE,/*87*/ 484 - MTK_PULL_PU_PD_TYPE,/*88*/ MTK_PULL_PU_PD_TYPE,/*89*/ 485 - MTK_PULL_PU_PD_TYPE,/*90*/ MTK_PULL_PU_PD_TYPE,/*91*/ 486 - MTK_PULL_PU_PD_TYPE,/*92*/ MTK_PULL_PU_PD_TYPE,/*93*/ 487 - MTK_PULL_PU_PD_TYPE,/*94*/ MTK_PULL_PU_PD_TYPE,/*95*/ 488 - MTK_PULL_PU_PD_TYPE,/*96*/ MTK_PULL_PU_PD_TYPE,/*97*/ 489 - MTK_PULL_PU_PD_TYPE,/*98*/ MTK_PULL_PU_PD_TYPE,/*99*/ 490 - MTK_PULL_PU_PD_TYPE,/*100*/ 460 + MTK_PULL_PU_PD_TYPE,/*40*/ MTK_PULL_PU_PD_TYPE,/*41*/ 461 + MTK_PULL_PU_PD_TYPE,/*42*/ MTK_PULL_PU_PD_TYPE,/*43*/ 462 + MTK_PULL_PU_PD_TYPE,/*44*/ MTK_PULL_PU_PD_TYPE,/*45*/ 463 + MTK_PULL_PU_PD_TYPE,/*46*/ MTK_PULL_PU_PD_TYPE,/*47*/ 464 + MTK_PULL_PU_PD_TYPE,/*48*/ MTK_PULL_PU_PD_TYPE,/*49*/ 465 + MTK_PULL_PU_PD_TYPE,/*50*/ MTK_PULL_PU_PD_TYPE,/*51*/ 466 + MTK_PULL_PU_PD_TYPE,/*52*/ MTK_PULL_PU_PD_TYPE,/*53*/ 467 + MTK_PULL_PU_PD_TYPE,/*54*/ MTK_PULL_PU_PD_TYPE,/*55*/ 468 + MTK_PULL_PU_PD_TYPE,/*56*/ 491 469 }; 492 470 493 471 static const struct mtk_pin_reg_calc mt7981_reg_cals[] = { ··· 992 1014 .ies_present = false, 993 1015 .base_names = mt7981_pinctrl_register_base_names, 994 1016 .nbase_names = ARRAY_SIZE(mt7981_pinctrl_register_base_names), 1017 + .bias_disable_set = mtk_pinconf_bias_disable_set, 1018 + .bias_disable_get = mtk_pinconf_bias_disable_get, 1019 + .bias_set = mtk_pinconf_bias_set, 1020 + .bias_get = mtk_pinconf_bias_get, 995 1021 .pull_type = mt7981_pull_type, 996 1022 .bias_set_combo = mtk_pinconf_bias_set_combo, 997 1023 .bias_get_combo = mtk_pinconf_bias_get_combo,
+8
drivers/pinctrl/mediatek/pinctrl-mt7986.c
··· 922 922 .ies_present = false, 923 923 .base_names = mt7986_pinctrl_register_base_names, 924 924 .nbase_names = ARRAY_SIZE(mt7986_pinctrl_register_base_names), 925 + .bias_disable_set = mtk_pinconf_bias_disable_set, 926 + .bias_disable_get = mtk_pinconf_bias_disable_get, 927 + .bias_set = mtk_pinconf_bias_set, 928 + .bias_get = mtk_pinconf_bias_get, 925 929 .pull_type = mt7986_pull_type, 926 930 .bias_set_combo = mtk_pinconf_bias_set_combo, 927 931 .bias_get_combo = mtk_pinconf_bias_get_combo, ··· 948 944 .ies_present = false, 949 945 .base_names = mt7986_pinctrl_register_base_names, 950 946 .nbase_names = ARRAY_SIZE(mt7986_pinctrl_register_base_names), 947 + .bias_disable_set = mtk_pinconf_bias_disable_set, 948 + .bias_disable_get = mtk_pinconf_bias_disable_get, 949 + .bias_set = mtk_pinconf_bias_set, 950 + .bias_get = mtk_pinconf_bias_get, 951 951 .pull_type = mt7986_pull_type, 952 952 .bias_set_combo = mtk_pinconf_bias_set_combo, 953 953 .bias_get_combo = mtk_pinconf_bias_get_combo,
-1
drivers/pinctrl/mediatek/pinctrl-mt8127.c
··· 8 8 #include <linux/init.h> 9 9 #include <linux/platform_device.h> 10 10 #include <linux/of.h> 11 - #include <linux/of_device.h> 12 11 #include <linux/pinctrl/pinctrl.h> 13 12 #include <linux/regmap.h> 14 13 #include <dt-bindings/pinctrl/mt65xx.h>
-1
drivers/pinctrl/mediatek/pinctrl-mt8135.c
··· 7 7 #include <linux/init.h> 8 8 #include <linux/platform_device.h> 9 9 #include <linux/of.h> 10 - #include <linux/of_device.h> 11 10 #include <linux/pinctrl/pinctrl.h> 12 11 #include <linux/regmap.h> 13 12 #include <dt-bindings/pinctrl/mt65xx.h>
-1
drivers/pinctrl/mediatek/pinctrl-mt8167.c
··· 6 6 7 7 #include <dt-bindings/pinctrl/mt65xx.h> 8 8 #include <linux/of.h> 9 - #include <linux/of_device.h> 10 9 #include <linux/module.h> 11 10 #include <linux/pinctrl/pinctrl.h> 12 11 #include <linux/platform_device.h>
-1
drivers/pinctrl/mediatek/pinctrl-mt8173.c
··· 7 7 #include <linux/init.h> 8 8 #include <linux/platform_device.h> 9 9 #include <linux/of.h> 10 - #include <linux/of_device.h> 11 10 #include <linux/pinctrl/pinctrl.h> 12 11 #include <linux/regmap.h> 13 12 #include <linux/pinctrl/pinconf-generic.h>
-1
drivers/pinctrl/mediatek/pinctrl-mt8365.c
··· 6 6 7 7 #include <dt-bindings/pinctrl/mt65xx.h> 8 8 #include <linux/of.h> 9 - #include <linux/of_device.h> 10 9 #include <linux/module.h> 11 10 #include <linux/pinctrl/pinctrl.h> 12 11 #include <linux/platform_device.h>
-1
drivers/pinctrl/mediatek/pinctrl-mt8516.c
··· 6 6 7 7 #include <dt-bindings/pinctrl/mt65xx.h> 8 8 #include <linux/of.h> 9 - #include <linux/of_device.h> 10 9 #include <linux/module.h> 11 10 #include <linux/pinctrl/pinctrl.h> 12 11 #include <linux/platform_device.h>
-2
drivers/pinctrl/mediatek/pinctrl-mtk-common.c
··· 8 8 #include <linux/io.h> 9 9 #include <linux/gpio/driver.h> 10 10 #include <linux/of.h> 11 - #include <linux/of_address.h> 12 - #include <linux/of_device.h> 13 11 #include <linux/of_irq.h> 14 12 #include <linux/pinctrl/consumer.h> 15 13 #include <linux/pinctrl/machine.h>
+6
drivers/pinctrl/meson/Kconfig
··· 67 67 select PINCTRL_MESON_AXG_PMX 68 68 default y 69 69 70 + config PINCTRL_AMLOGIC_C3 71 + tristate "Amlogic C3 SoC pinctrl driver" 72 + depends on ARM64 73 + select PINCTRL_MESON_AXG_PMX 74 + default y 75 + 70 76 endif
+1
drivers/pinctrl/meson/Makefile
··· 10 10 obj-$(CONFIG_PINCTRL_MESON_G12A) += pinctrl-meson-g12a.o 11 11 obj-$(CONFIG_PINCTRL_MESON_A1) += pinctrl-meson-a1.o 12 12 obj-$(CONFIG_PINCTRL_MESON_S4) += pinctrl-meson-s4.o 13 + obj-$(CONFIG_PINCTRL_AMLOGIC_C3) += pinctrl-amlogic-c3.o
+1108
drivers/pinctrl/meson/pinctrl-amlogic-c3.c
··· 1 + // SPDX-License-Identifier: (GPL-2.0-only OR MIT) 2 + /* 3 + * Pin controller and GPIO driver for Amlogic C3 SoC. 4 + * 5 + * Copyright (c) 2021 Amlogic, Inc. All rights reserved. 6 + * Author: Huqiang Qin <huqiang.qin@amlogic.com> 7 + */ 8 + 9 + #include <dt-bindings/gpio/amlogic-c3-gpio.h> 10 + #include "pinctrl-meson.h" 11 + #include "pinctrl-meson-axg-pmx.h" 12 + 13 + static const struct pinctrl_pin_desc c3_periphs_pins[] = { 14 + MESON_PIN(GPIOE_0), 15 + MESON_PIN(GPIOE_1), 16 + MESON_PIN(GPIOE_2), 17 + MESON_PIN(GPIOE_3), 18 + MESON_PIN(GPIOE_4), 19 + MESON_PIN(GPIOB_0), 20 + MESON_PIN(GPIOB_1), 21 + MESON_PIN(GPIOB_2), 22 + MESON_PIN(GPIOB_3), 23 + MESON_PIN(GPIOB_4), 24 + MESON_PIN(GPIOB_5), 25 + MESON_PIN(GPIOB_6), 26 + MESON_PIN(GPIOB_7), 27 + MESON_PIN(GPIOB_8), 28 + MESON_PIN(GPIOB_9), 29 + MESON_PIN(GPIOB_10), 30 + MESON_PIN(GPIOB_11), 31 + MESON_PIN(GPIOB_12), 32 + MESON_PIN(GPIOB_13), 33 + MESON_PIN(GPIOB_14), 34 + MESON_PIN(GPIOC_0), 35 + MESON_PIN(GPIOC_1), 36 + MESON_PIN(GPIOC_2), 37 + MESON_PIN(GPIOC_3), 38 + MESON_PIN(GPIOC_4), 39 + MESON_PIN(GPIOC_5), 40 + MESON_PIN(GPIOC_6), 41 + MESON_PIN(GPIOX_0), 42 + MESON_PIN(GPIOX_1), 43 + MESON_PIN(GPIOX_2), 44 + MESON_PIN(GPIOX_3), 45 + MESON_PIN(GPIOX_4), 46 + MESON_PIN(GPIOX_5), 47 + MESON_PIN(GPIOX_6), 48 + MESON_PIN(GPIOX_7), 49 + MESON_PIN(GPIOX_8), 50 + MESON_PIN(GPIOX_9), 51 + MESON_PIN(GPIOX_10), 52 + MESON_PIN(GPIOX_11), 53 + MESON_PIN(GPIOX_12), 54 + MESON_PIN(GPIOX_13), 55 + MESON_PIN(GPIOD_0), 56 + MESON_PIN(GPIOD_1), 57 + MESON_PIN(GPIOD_2), 58 + MESON_PIN(GPIOD_3), 59 + MESON_PIN(GPIOD_4), 60 + MESON_PIN(GPIOD_5), 61 + MESON_PIN(GPIOD_6), 62 + MESON_PIN(GPIOA_0), 63 + MESON_PIN(GPIOA_1), 64 + MESON_PIN(GPIOA_2), 65 + MESON_PIN(GPIOA_3), 66 + MESON_PIN(GPIOA_4), 67 + MESON_PIN(GPIOA_5), 68 + MESON_PIN(GPIO_TEST_N), 69 + }; 70 + 71 + /* Bank E func1 */ 72 + static const unsigned int pwm_a_pins[] = { GPIOE_0 }; 73 + static const unsigned int pwm_b_pins[] = { GPIOE_1 }; 74 + static const unsigned int i2c2_sda_pins[] = { GPIOE_2 }; 75 + static const unsigned int i2c2_scl_pins[] = { GPIOE_3 }; 76 + static const unsigned int gen_clk_e_pins[] = { GPIOE_4 }; 77 + 78 + /* Bank E func2 */ 79 + static const unsigned int i2c0_sda_e_pins[] = { GPIOE_0 }; 80 + static const unsigned int i2c0_scl_e_pins[] = { GPIOE_1 }; 81 + static const unsigned int clk_32k_in_pins[] = { GPIOE_4 }; 82 + 83 + /* Bank E func3 */ 84 + static const unsigned int i2c_slave_scl_pins[] = { GPIOE_0 }; 85 + static const unsigned int i2c_slave_sda_pins[] = { GPIOE_1 }; 86 + static const unsigned int clk12_24_e_pins[] = { GPIOE_4 }; 87 + 88 + /* Bank B func1 */ 89 + static const unsigned int emmc_nand_d0_pins[] = { GPIOB_0 }; 90 + static const unsigned int emmc_nand_d1_pins[] = { GPIOB_1 }; 91 + static const unsigned int emmc_nand_d2_pins[] = { GPIOB_2 }; 92 + static const unsigned int emmc_nand_d3_pins[] = { GPIOB_3 }; 93 + static const unsigned int emmc_nand_d4_pins[] = { GPIOB_4 }; 94 + static const unsigned int emmc_nand_d5_pins[] = { GPIOB_5 }; 95 + static const unsigned int emmc_nand_d6_pins[] = { GPIOB_6 }; 96 + static const unsigned int emmc_nand_d7_pins[] = { GPIOB_7 }; 97 + static const unsigned int emmc_clk_pins[] = { GPIOB_8 }; 98 + static const unsigned int emmc_rst_pins[] = { GPIOB_9 }; 99 + static const unsigned int emmc_cmd_pins[] = { GPIOB_10 }; 100 + static const unsigned int emmc_nand_ds_pins[] = { GPIOB_11 }; 101 + 102 + /* Bank B func2 */ 103 + static const unsigned int nand_wen_clk_pins[] = { GPIOB_8 }; 104 + static const unsigned int nand_ale_pins[] = { GPIOB_9 }; 105 + static const unsigned int nand_ren_wr_pins[] = { GPIOB_10 }; 106 + static const unsigned int nand_cle_pins[] = { GPIOB_11 }; 107 + static const unsigned int nand_ce0_pins[] = { GPIOB_12 }; 108 + 109 + /* Bank B func3 */ 110 + static const unsigned int pwm_g_b_pins[] = { GPIOB_0 }; 111 + static const unsigned int pwm_h_b_pins[] = { GPIOB_1 }; 112 + static const unsigned int pwm_i_b_pins[] = { GPIOB_2 }; 113 + static const unsigned int spif_hold_pins[] = { GPIOB_3 }; 114 + static const unsigned int spif_mo_pins[] = { GPIOB_4 }; 115 + static const unsigned int spif_mi_pins[] = { GPIOB_5 }; 116 + static const unsigned int spif_clk_pins[] = { GPIOB_6 }; 117 + static const unsigned int spif_wp_pins[] = { GPIOB_7 }; 118 + static const unsigned int pwm_j_b_pins[] = { GPIOB_8 }; 119 + static const unsigned int pwm_k_b_pins[] = { GPIOB_9 }; 120 + static const unsigned int pwm_l_b_pins[] = { GPIOB_10 }; 121 + static const unsigned int pwm_m_b_pins[] = { GPIOB_11 }; 122 + static const unsigned int pwm_n_b_pins[] = { GPIOB_12 }; 123 + static const unsigned int spif_cs_pins[] = { GPIOB_13 }; 124 + static const unsigned int spif_clk_loop_pins[] = { GPIOB_14 }; 125 + 126 + /* Bank B func4 */ 127 + static const unsigned int lcd_d0_pins[] = { GPIOB_0 }; 128 + static const unsigned int lcd_d1_pins[] = { GPIOB_1 }; 129 + static const unsigned int lcd_d2_pins[] = { GPIOB_2 }; 130 + static const unsigned int lcd_d3_pins[] = { GPIOB_8 }; 131 + static const unsigned int lcd_d4_pins[] = { GPIOB_9 }; 132 + static const unsigned int lcd_d5_pins[] = { GPIOB_10 }; 133 + static const unsigned int lcd_d6_pins[] = { GPIOB_11 }; 134 + static const unsigned int lcd_d7_pins[] = { GPIOB_12 }; 135 + 136 + /* Bank B func5 */ 137 + static const unsigned int spi_a_mosi_b_pins[] = { GPIOB_0 }; 138 + static const unsigned int spi_a_miso_b_pins[] = { GPIOB_1 }; 139 + static const unsigned int spi_a_clk_b_pins[] = { GPIOB_2 }; 140 + static const unsigned int spi_a_ss0_b_pins[] = { GPIOB_8 }; 141 + static const unsigned int spi_a_ss1_b_pins[] = { GPIOB_9 }; 142 + static const unsigned int spi_a_ss2_b_pins[] = { GPIOB_10 }; 143 + static const unsigned int i2c1_sda_b_pins[] = { GPIOB_11 }; 144 + static const unsigned int i2c1_scl_b_pins[] = { GPIOB_12 }; 145 + 146 + /* Bank B func6 */ 147 + static const unsigned int uart_a_tx_b_pins[] = { GPIOB_0 }; 148 + static const unsigned int uart_a_rx_b_pins[] = { GPIOB_1 }; 149 + static const unsigned int uart_a_cts_b_pins[] = { GPIOB_2 }; 150 + static const unsigned int uart_a_rts_b_pins[] = { GPIOB_8 }; 151 + static const unsigned int uart_d_tx_b_pins[] = { GPIOB_9 }; 152 + static const unsigned int uart_d_rx_b_pins[] = { GPIOB_10 }; 153 + static const unsigned int pdm_dclk_b_pins[] = { GPIOB_11 }; 154 + static const unsigned int pdm_din0_b_pins[] = { GPIOB_12 }; 155 + 156 + /* Bank C func1 */ 157 + static const unsigned int sdcard_d0_pins[] = { GPIOC_0 }; 158 + static const unsigned int sdcard_d1_pins[] = { GPIOC_1 }; 159 + static const unsigned int sdcard_d2_pins[] = { GPIOC_2 }; 160 + static const unsigned int sdcard_d3_pins[] = { GPIOC_3 }; 161 + static const unsigned int sdcard_clk_pins[] = { GPIOC_4 }; 162 + static const unsigned int sdcard_cmd_pins[] = { GPIOC_5 }; 163 + static const unsigned int sdcard_cd_pins[] = { GPIOC_6 }; 164 + 165 + /* Bank C func2 */ 166 + static const unsigned int jtag_b_tdo_pins[] = { GPIOC_0 }; 167 + static const unsigned int jtag_b_tdi_pins[] = { GPIOC_1 }; 168 + static const unsigned int uart_b_rx_c_pins[] = { GPIOC_2 }; 169 + static const unsigned int uart_b_tx_c_pins[] = { GPIOC_3 }; 170 + static const unsigned int jtag_b_clk_pins[] = { GPIOC_4 }; 171 + static const unsigned int jtag_b_tms_pins[] = { GPIOC_5 }; 172 + static const unsigned int gen_clk_c_pins[] = { GPIOC_6 }; 173 + 174 + /* Bank C func3 */ 175 + static const unsigned int tdm_d3_pins[] = { GPIOC_0 }; 176 + static const unsigned int tdm_d2_pins[] = { GPIOC_1 }; 177 + static const unsigned int mclk_1_pins[] = { GPIOC_2 }; 178 + static const unsigned int tdm_sclk1_pins[] = { GPIOC_3 }; 179 + static const unsigned int tdm_fs1_pins[] = { GPIOC_4 }; 180 + static const unsigned int pdm_dclk_c_pins[] = { GPIOC_5 }; 181 + static const unsigned int pdm_din0_c_pins[] = { GPIOC_6 }; 182 + 183 + /* Bank C func4 */ 184 + static const unsigned int spi_a_mosi_c_pins[] = { GPIOC_0 }; 185 + static const unsigned int spi_a_miso_c_pins[] = { GPIOC_1 }; 186 + static const unsigned int spi_a_clk_c_pins[] = { GPIOC_2 }; 187 + static const unsigned int spi_a_ss0_c_pins[] = { GPIOC_3 }; 188 + static const unsigned int spi_a_ss1_c_pins[] = { GPIOC_4 }; 189 + 190 + /* Bank C func5 */ 191 + static const unsigned int pwm_g_c_pins[] = { GPIOC_0 }; 192 + static const unsigned int pwm_h_c_pins[] = { GPIOC_1 }; 193 + static const unsigned int pwm_i_c_pins[] = { GPIOC_2 }; 194 + static const unsigned int pwm_j_c_pins[] = { GPIOC_3 }; 195 + static const unsigned int pwm_k_c_pins[] = { GPIOC_4 }; 196 + static const unsigned int pwm_l_c_pins[] = { GPIOC_5 }; 197 + static const unsigned int pwm_m_c_pins[] = { GPIOC_6 }; 198 + 199 + /* Bank C func6 */ 200 + static const unsigned int uart_a_rx_c_pins[] = { GPIOC_0 }; 201 + static const unsigned int uart_a_tx_c_pins[] = { GPIOC_1 }; 202 + static const unsigned int uart_c_rx_c_pins[] = { GPIOC_2 }; 203 + static const unsigned int uart_c_tx_c_pins[] = { GPIOC_3 }; 204 + static const unsigned int i2c3_sda_c_pins[] = { GPIOC_4 }; 205 + static const unsigned int i2c3_scl_c_pins[] = { GPIOC_5 }; 206 + static const unsigned int clk12_24_c_pins[] = { GPIOC_6 }; 207 + 208 + /* Bank X func1 */ 209 + static const unsigned int sdio_d0_pins[] = { GPIOX_0 }; 210 + static const unsigned int sdio_d1_pins[] = { GPIOX_1 }; 211 + static const unsigned int sdio_d2_pins[] = { GPIOX_2 }; 212 + static const unsigned int sdio_d3_pins[] = { GPIOX_3 }; 213 + static const unsigned int sdio_clk_pins[] = { GPIOX_4 }; 214 + static const unsigned int sdio_cmd_pins[] = { GPIOX_5 }; 215 + static const unsigned int clk12_24_x_pins[] = { GPIOX_6 }; 216 + static const unsigned int uart_e_tx_x_pins[] = { GPIOX_7 }; 217 + static const unsigned int uart_e_rx_x_pins[] = { GPIOX_8 }; 218 + static const unsigned int uart_e_cts_pins[] = { GPIOX_9 }; 219 + static const unsigned int uart_e_rts_pins[] = { GPIOX_10 }; 220 + static const unsigned int pwm_e_pins[] = { GPIOX_11 }; 221 + static const unsigned int pwm_j_x12_pins[] = { GPIOX_12 }; 222 + static const unsigned int pwm_k_x13_pins[] = { GPIOX_13 }; 223 + 224 + /* Bank X func2 */ 225 + static const unsigned int spi_a_mosi_x_pins[] = { GPIOX_0 }; 226 + static const unsigned int spi_a_miso_x_pins[] = { GPIOX_1 }; 227 + static const unsigned int spi_a_clk_x_pins[] = { GPIOX_2 }; 228 + static const unsigned int spi_a_ss0_x_pins[] = { GPIOX_3 }; 229 + static const unsigned int spi_a_ss1_x_pins[] = { GPIOX_4 }; 230 + static const unsigned int spi_a_ss2_x_pins[] = { GPIOX_5 }; 231 + static const unsigned int spi_b_ss2_x6_pins[] = { GPIOX_6 }; 232 + static const unsigned int spi_b_miso_x_pins[] = { GPIOX_7 }; 233 + static const unsigned int spi_b_clk_x_pins[] = { GPIOX_8 }; 234 + static const unsigned int spi_b_mosi_x_pins[] = { GPIOX_9 }; 235 + static const unsigned int spi_b_ss0_x_pins[] = { GPIOX_10 }; 236 + static const unsigned int spi_b_ss1_x_pins[] = { GPIOX_11 }; 237 + static const unsigned int spi_b_ss2_x12_pins[] = { GPIOX_12 }; 238 + static const unsigned int gen_clk_x_pins[] = { GPIOX_13 }; 239 + 240 + /* Bank X func3 */ 241 + static const unsigned int tdm_d1_x_pins[] = { GPIOX_0 }; 242 + static const unsigned int tdm_d0_x_pins[] = { GPIOX_1 }; 243 + static const unsigned int mclk_0_x_pins[] = { GPIOX_2 }; 244 + static const unsigned int tdm_sclk0_x_pins[] = { GPIOX_3 }; 245 + static const unsigned int tdm_fs0_x_pins[] = { GPIOX_4 }; 246 + static const unsigned int pdm_dclk_x5_pins[] = { GPIOX_5 }; 247 + static const unsigned int pdm_din0_x6_pins[] = { GPIOX_6 }; 248 + static const unsigned int pdm_din0_x9_pins[] = { GPIOX_9 }; 249 + static const unsigned int pdm_dclk_x10_pins[] = { GPIOX_10 }; 250 + static const unsigned int clk12_24_x13_pins[] = { GPIOX_13 }; 251 + 252 + /* Bank X func4 */ 253 + static const unsigned int lcd_d8_pins[] = { GPIOX_0 }; 254 + static const unsigned int lcd_d9_pins[] = { GPIOX_1 }; 255 + static const unsigned int lcd_d10_pins[] = { GPIOX_2 }; 256 + static const unsigned int lcd_d11_pins[] = { GPIOX_3 }; 257 + static const unsigned int lcd_d12_pins[] = { GPIOX_4 }; 258 + static const unsigned int lcd_d13_pins[] = { GPIOX_5 }; 259 + static const unsigned int lcd_d14_pins[] = { GPIOX_6 }; 260 + static const unsigned int lcd_d15_pins[] = { GPIOX_7 }; 261 + static const unsigned int lcd_vs_pins[] = { GPIOX_8 }; 262 + static const unsigned int lcd_hs_pins[] = { GPIOX_9 }; 263 + static const unsigned int lcd_den_pins[] = { GPIOX_10 }; 264 + static const unsigned int lcd_d16_pins[] = { GPIOX_11 }; 265 + static const unsigned int lcd_clk_x_pins[] = { GPIOX_12 }; 266 + static const unsigned int lcd_d17_pins[] = { GPIOX_13 }; 267 + 268 + /* Bank X func5 */ 269 + static const unsigned int pwm_g_x0_pins[] = { GPIOX_0 }; 270 + static const unsigned int pwm_h_x1_pins[] = { GPIOX_1 }; 271 + static const unsigned int pwm_i_x2_pins[] = { GPIOX_2 }; 272 + static const unsigned int pwm_j_x3_pins[] = { GPIOX_3 }; 273 + static const unsigned int pwm_k_x4_pins[] = { GPIOX_4 }; 274 + static const unsigned int pwm_l_x_pins[] = { GPIOX_5 }; 275 + static const unsigned int pwm_m_x_pins[] = { GPIOX_6 }; 276 + static const unsigned int pwm_n_x_pins[] = { GPIOX_7 }; 277 + static const unsigned int pwm_g_x8_pins[] = { GPIOX_8 }; 278 + static const unsigned int pwm_h_x9_pins[] = { GPIOX_9 }; 279 + static const unsigned int pwm_i_x10_pins[] = { GPIOX_10 }; 280 + static const unsigned int clk12_24_x11_pins[] = { GPIOX_11 }; 281 + 282 + /* Bank X func6 */ 283 + static const unsigned int uart_a_rx_x_pins[] = { GPIOX_0 }; 284 + static const unsigned int uart_a_tx_x_pins[] = { GPIOX_1 }; 285 + static const unsigned int uart_c_rx_x_pins[] = { GPIOX_2 }; 286 + static const unsigned int uart_c_tx_x_pins[] = { GPIOX_3 }; 287 + static const unsigned int i2c3_sda_x_pins[] = { GPIOX_4 }; 288 + static const unsigned int i2c3_scl_x_pins[] = { GPIOX_5 }; 289 + static const unsigned int i2c1_sda_x_pins[] = { GPIOX_7 }; 290 + static const unsigned int i2c1_scl_x_pins[] = { GPIOX_8 }; 291 + static const unsigned int uart_d_tx_x_pins[] = { GPIOX_9 }; 292 + static const unsigned int uart_d_rx_x_pins[] = { GPIOX_10 }; 293 + 294 + /* Bank D func1 */ 295 + static const unsigned int pwm_g_d_pins[] = { GPIOD_0 }; 296 + static const unsigned int pwm_h_d_pins[] = { GPIOD_1 }; 297 + static const unsigned int eth_led_act_pins[] = { GPIOD_2 }; 298 + static const unsigned int eth_led_link_pins[] = { GPIOD_3 }; 299 + static const unsigned int pwm_d_pins[] = { GPIOD_4 }; 300 + static const unsigned int pwm_f_pins[] = { GPIOD_5 }; 301 + static const unsigned int pwm_k_d_pins[] = { GPIOD_6 }; 302 + 303 + /* Bank D func2 */ 304 + static const unsigned int uart_a_tx_d_pins[] = { GPIOD_0 }; 305 + static const unsigned int uart_a_rx_d_pins[] = { GPIOD_1 }; 306 + static const unsigned int spi_b_miso_d_pins[] = { GPIOD_2 }; 307 + static const unsigned int spi_b_clk_d_pins[] = { GPIOD_3 }; 308 + static const unsigned int spi_b_mosi_d_pins[] = { GPIOD_4 }; 309 + static const unsigned int spi_b_ss0_d_pins[] = { GPIOD_5 }; 310 + static const unsigned int spi_b_ss1_d_pins[] = { GPIOD_6 }; 311 + 312 + /* Bank D func3 */ 313 + static const unsigned int i2c0_sda_d_pins[] = { GPIOD_0 }; 314 + static const unsigned int i2c0_scl_d_pins[] = { GPIOD_1 }; 315 + static const unsigned int i2c1_sda_d_pins[] = { GPIOD_2 }; 316 + static const unsigned int i2c1_scl_d_pins[] = { GPIOD_3 }; 317 + static const unsigned int pdm_dclk_d_pins[] = { GPIOD_4 }; 318 + static const unsigned int pdm_din0_d_pins[] = { GPIOD_5 }; 319 + static const unsigned int ir_in_d6_pins[] = { GPIOD_6 }; 320 + 321 + /* Bank D func4 */ 322 + static const unsigned int ir_in_d0_pins[] = { GPIOD_0 }; 323 + static const unsigned int ir_out_pins[] = { GPIOD_1 }; 324 + static const unsigned int pwm_i_d_pins[] = { GPIOD_2 }; 325 + static const unsigned int pwm_j_d_pins[] = { GPIOD_3 }; 326 + static const unsigned int i2c3_sda_d_pins[] = { GPIOD_4 }; 327 + static const unsigned int i2c3_scl_d_pins[] = { GPIOD_5 }; 328 + 329 + /* Bank D func5 */ 330 + static const unsigned int tdm_fs0_d_pins[] = { GPIOD_2 }; 331 + static const unsigned int tdm_sclk0_d_pins[] = { GPIOD_3 }; 332 + static const unsigned int mclk_0_d_pins[] = { GPIOD_4 }; 333 + static const unsigned int tdm_d1_d_pins[] = { GPIOD_5 }; 334 + static const unsigned int tdm_d0_d_pins[] = { GPIOD_6 }; 335 + 336 + /* Bank D func6 */ 337 + static const unsigned int uart_d_tx_d_pins[] = { GPIOD_0 }; 338 + static const unsigned int uart_d_rx_d_pins[] = { GPIOD_1 }; 339 + static const unsigned int uart_c_tx_d_pins[] = { GPIOD_2 }; 340 + static const unsigned int uart_c_rx_d_pins[] = { GPIOD_3 }; 341 + 342 + /* Bank A func1 */ 343 + static const unsigned int uart_b_tx_a_pins[] = { GPIOA_0 }; 344 + static const unsigned int uart_b_rx_a_pins[] = { GPIOA_1 }; 345 + static const unsigned int pwm_c_pins[] = { GPIOA_2 }; 346 + static const unsigned int pwm_l_a_pins[] = { GPIOA_3 }; 347 + static const unsigned int i2c1_sda_a_pins[] = { GPIOA_4 }; 348 + static const unsigned int i2c1_scl_a_pins[] = { GPIOA_5 }; 349 + 350 + /* Bank A func2 */ 351 + static const unsigned int pwm_c_hiz_pins[] = { GPIOA_2 }; 352 + static const unsigned int gen_clk_a_pins[] = { GPIOA_3 }; 353 + static const unsigned int pdm_dclk_z_pins[] = { GPIOA_4 }; 354 + static const unsigned int pdm_din0_a_pins[] = { GPIOA_5 }; 355 + 356 + /* Bank A func3 */ 357 + static const unsigned int jtag_a_clk_pins[] = { GPIOA_2 }; 358 + static const unsigned int jtag_a_tms_pins[] = { GPIOA_3 }; 359 + static const unsigned int jtag_a_tdi_pins[] = { GPIOA_4 }; 360 + static const unsigned int jtag_a_tdo_pins[] = { GPIOA_5 }; 361 + 362 + /* Bank A func4 */ 363 + static const unsigned int lcd_clk_a_pins[] = { GPIOA_3 }; 364 + static const unsigned int uart_f_tx_a_pins[] = { GPIOA_4 }; 365 + static const unsigned int uart_f_rx_a_pins[] = { GPIOA_5 }; 366 + 367 + /* Bank A func5 */ 368 + static const unsigned int uart_e_tx_a_pins[] = { GPIOA_2 }; 369 + static const unsigned int uart_e_rx_a_pins[] = { GPIOA_3 }; 370 + static const unsigned int pwm_m_a_pins[] = { GPIOA_4 }; 371 + static const unsigned int pwm_n_a_pins[] = { GPIOA_5 }; 372 + 373 + /* Bank A func6 */ 374 + static const unsigned int spi_a_mosi_a_pins[] = { GPIOA_3 }; 375 + static const unsigned int gen_clk_a4_pins[] = { GPIOA_4 }; 376 + static const unsigned int clk12_24_a_pins[] = { GPIOA_5 }; 377 + 378 + static struct meson_pmx_group c3_periphs_groups[] = { 379 + GPIO_GROUP(GPIOE_0), 380 + GPIO_GROUP(GPIOE_1), 381 + GPIO_GROUP(GPIOE_2), 382 + GPIO_GROUP(GPIOE_3), 383 + GPIO_GROUP(GPIOE_4), 384 + GPIO_GROUP(GPIOB_0), 385 + GPIO_GROUP(GPIOB_1), 386 + GPIO_GROUP(GPIOB_2), 387 + GPIO_GROUP(GPIOB_3), 388 + GPIO_GROUP(GPIOB_4), 389 + GPIO_GROUP(GPIOB_5), 390 + GPIO_GROUP(GPIOB_6), 391 + GPIO_GROUP(GPIOB_7), 392 + GPIO_GROUP(GPIOB_8), 393 + GPIO_GROUP(GPIOB_9), 394 + GPIO_GROUP(GPIOB_10), 395 + GPIO_GROUP(GPIOB_11), 396 + GPIO_GROUP(GPIOB_12), 397 + GPIO_GROUP(GPIOB_13), 398 + GPIO_GROUP(GPIOB_14), 399 + GPIO_GROUP(GPIOC_0), 400 + GPIO_GROUP(GPIOC_1), 401 + GPIO_GROUP(GPIOC_2), 402 + GPIO_GROUP(GPIOC_3), 403 + GPIO_GROUP(GPIOC_4), 404 + GPIO_GROUP(GPIOC_5), 405 + GPIO_GROUP(GPIOC_6), 406 + GPIO_GROUP(GPIOX_0), 407 + GPIO_GROUP(GPIOX_1), 408 + GPIO_GROUP(GPIOX_2), 409 + GPIO_GROUP(GPIOX_3), 410 + GPIO_GROUP(GPIOX_4), 411 + GPIO_GROUP(GPIOX_5), 412 + GPIO_GROUP(GPIOX_6), 413 + GPIO_GROUP(GPIOX_7), 414 + GPIO_GROUP(GPIOX_8), 415 + GPIO_GROUP(GPIOX_9), 416 + GPIO_GROUP(GPIOX_10), 417 + GPIO_GROUP(GPIOX_11), 418 + GPIO_GROUP(GPIOX_12), 419 + GPIO_GROUP(GPIOX_13), 420 + GPIO_GROUP(GPIOD_0), 421 + GPIO_GROUP(GPIOD_1), 422 + GPIO_GROUP(GPIOD_2), 423 + GPIO_GROUP(GPIOD_3), 424 + GPIO_GROUP(GPIOD_4), 425 + GPIO_GROUP(GPIOD_5), 426 + GPIO_GROUP(GPIOD_6), 427 + GPIO_GROUP(GPIOA_0), 428 + GPIO_GROUP(GPIOA_1), 429 + GPIO_GROUP(GPIOA_2), 430 + GPIO_GROUP(GPIOA_3), 431 + GPIO_GROUP(GPIOA_4), 432 + GPIO_GROUP(GPIOA_5), 433 + GPIO_GROUP(GPIO_TEST_N), 434 + 435 + /* Bank E func1 */ 436 + GROUP(pwm_a, 1), 437 + GROUP(pwm_b, 1), 438 + GROUP(i2c2_sda, 1), 439 + GROUP(i2c2_scl, 1), 440 + GROUP(gen_clk_e, 1), 441 + 442 + /* Bank E func2 */ 443 + GROUP(i2c0_sda_e, 2), 444 + GROUP(i2c0_scl_e, 2), 445 + GROUP(clk_32k_in, 2), 446 + 447 + /* Bank E func3 */ 448 + GROUP(i2c_slave_scl, 3), 449 + GROUP(i2c_slave_sda, 3), 450 + GROUP(clk12_24_e, 3), 451 + 452 + /* Bank B func1 */ 453 + GROUP(emmc_nand_d0, 1), 454 + GROUP(emmc_nand_d1, 1), 455 + GROUP(emmc_nand_d2, 1), 456 + GROUP(emmc_nand_d3, 1), 457 + GROUP(emmc_nand_d4, 1), 458 + GROUP(emmc_nand_d5, 1), 459 + GROUP(emmc_nand_d6, 1), 460 + GROUP(emmc_nand_d7, 1), 461 + GROUP(emmc_clk, 1), 462 + GROUP(emmc_rst, 1), 463 + GROUP(emmc_cmd, 1), 464 + GROUP(emmc_nand_ds, 1), 465 + 466 + /* Bank B func2 */ 467 + GROUP(nand_wen_clk, 2), 468 + GROUP(nand_ale, 2), 469 + GROUP(nand_ren_wr, 2), 470 + GROUP(nand_cle, 2), 471 + GROUP(nand_ce0, 2), 472 + 473 + /* Bank B func3 */ 474 + GROUP(pwm_g_b, 3), 475 + GROUP(pwm_h_b, 3), 476 + GROUP(pwm_i_b, 3), 477 + GROUP(spif_hold, 3), 478 + GROUP(spif_mo, 3), 479 + GROUP(spif_mi, 3), 480 + GROUP(spif_clk, 3), 481 + GROUP(spif_wp, 3), 482 + GROUP(pwm_j_b, 3), 483 + GROUP(pwm_k_b, 3), 484 + GROUP(pwm_l_b, 3), 485 + GROUP(pwm_m_b, 3), 486 + GROUP(pwm_n_b, 3), 487 + GROUP(spif_cs, 3), 488 + GROUP(spif_clk_loop, 3), 489 + 490 + /* Bank B func4 */ 491 + GROUP(lcd_d0, 4), 492 + GROUP(lcd_d1, 4), 493 + GROUP(lcd_d2, 4), 494 + GROUP(lcd_d3, 4), 495 + GROUP(lcd_d4, 4), 496 + GROUP(lcd_d5, 4), 497 + GROUP(lcd_d6, 4), 498 + GROUP(lcd_d7, 4), 499 + 500 + /* Bank B func5 */ 501 + GROUP(spi_a_mosi_b, 5), 502 + GROUP(spi_a_miso_b, 5), 503 + GROUP(spi_a_clk_b, 5), 504 + GROUP(spi_a_ss0_b, 5), 505 + GROUP(spi_a_ss1_b, 5), 506 + GROUP(spi_a_ss2_b, 5), 507 + GROUP(i2c1_sda_b, 5), 508 + GROUP(i2c1_scl_b, 5), 509 + 510 + /* Bank B func6 */ 511 + GROUP(uart_a_tx_b, 6), 512 + GROUP(uart_a_rx_b, 6), 513 + GROUP(uart_a_cts_b, 6), 514 + GROUP(uart_a_rts_b, 6), 515 + GROUP(uart_d_tx_b, 6), 516 + GROUP(uart_d_rx_b, 6), 517 + GROUP(pdm_dclk_b, 6), 518 + GROUP(pdm_din0_b, 6), 519 + 520 + /* Bank C func1 */ 521 + GROUP(sdcard_d0, 1), 522 + GROUP(sdcard_d1, 1), 523 + GROUP(sdcard_d2, 1), 524 + GROUP(sdcard_d3, 1), 525 + GROUP(sdcard_clk, 1), 526 + GROUP(sdcard_cmd, 1), 527 + GROUP(sdcard_cd, 1), 528 + 529 + /* Bank C func2 */ 530 + GROUP(jtag_b_tdo, 2), 531 + GROUP(jtag_b_tdi, 2), 532 + GROUP(uart_b_rx_c, 2), 533 + GROUP(uart_b_tx_c, 2), 534 + GROUP(jtag_b_clk, 2), 535 + GROUP(jtag_b_tms, 2), 536 + GROUP(gen_clk_c, 2), 537 + 538 + /* Bank C func3 */ 539 + GROUP(tdm_d3, 3), 540 + GROUP(tdm_d2, 3), 541 + GROUP(mclk_1, 3), 542 + GROUP(tdm_sclk1, 3), 543 + GROUP(tdm_fs1, 3), 544 + GROUP(pdm_dclk_c, 3), 545 + GROUP(pdm_din0_c, 3), 546 + 547 + /* Bank C func4 */ 548 + GROUP(spi_a_mosi_c, 4), 549 + GROUP(spi_a_miso_c, 4), 550 + GROUP(spi_a_clk_c, 4), 551 + GROUP(spi_a_ss0_c, 4), 552 + GROUP(spi_a_ss1_c, 4), 553 + 554 + /* Bank C func5 */ 555 + GROUP(pwm_g_c, 5), 556 + GROUP(pwm_h_c, 5), 557 + GROUP(pwm_i_c, 5), 558 + GROUP(pwm_j_c, 5), 559 + GROUP(pwm_k_c, 5), 560 + GROUP(pwm_l_c, 5), 561 + GROUP(pwm_m_c, 5), 562 + 563 + /* Bank C func6 */ 564 + GROUP(uart_a_rx_c, 6), 565 + GROUP(uart_a_tx_c, 6), 566 + GROUP(uart_c_rx_c, 6), 567 + GROUP(uart_c_tx_c, 6), 568 + GROUP(i2c3_sda_c, 6), 569 + GROUP(i2c3_scl_c, 6), 570 + GROUP(clk12_24_c, 6), 571 + 572 + /* Bank X func1 */ 573 + GROUP(sdio_d0, 1), 574 + GROUP(sdio_d1, 1), 575 + GROUP(sdio_d2, 1), 576 + GROUP(sdio_d3, 1), 577 + GROUP(sdio_clk, 1), 578 + GROUP(sdio_cmd, 1), 579 + GROUP(clk12_24_x, 1), 580 + GROUP(uart_e_tx_x, 1), 581 + GROUP(uart_e_rx_x, 1), 582 + GROUP(uart_e_cts, 1), 583 + GROUP(uart_e_rts, 1), 584 + GROUP(pwm_e, 1), 585 + GROUP(pwm_j_x12, 1), 586 + GROUP(pwm_k_x13, 1), 587 + 588 + /* Bank X func2 */ 589 + GROUP(spi_a_mosi_x, 2), 590 + GROUP(spi_a_miso_x, 2), 591 + GROUP(spi_a_clk_x, 2), 592 + GROUP(spi_a_ss0_x, 2), 593 + GROUP(spi_a_ss1_x, 2), 594 + GROUP(spi_a_ss2_x, 2), 595 + GROUP(spi_b_ss2_x6, 2), 596 + GROUP(spi_b_miso_x, 2), 597 + GROUP(spi_b_clk_x, 2), 598 + GROUP(spi_b_mosi_x, 2), 599 + GROUP(spi_b_ss0_x, 2), 600 + GROUP(spi_b_ss1_x, 2), 601 + GROUP(spi_b_ss2_x12, 2), 602 + GROUP(gen_clk_x, 2), 603 + 604 + /* Bank X func3 */ 605 + GROUP(tdm_d1_x, 3), 606 + GROUP(tdm_d0_x, 3), 607 + GROUP(mclk_0_x, 3), 608 + GROUP(tdm_sclk0_x, 3), 609 + GROUP(tdm_fs0_x, 3), 610 + GROUP(pdm_dclk_x5, 3), 611 + GROUP(pdm_din0_x6, 3), 612 + GROUP(pdm_din0_x9, 3), 613 + GROUP(pdm_dclk_x10, 3), 614 + GROUP(clk12_24_x13, 3), 615 + 616 + /* Bank X func4 */ 617 + GROUP(lcd_d8, 4), 618 + GROUP(lcd_d9, 4), 619 + GROUP(lcd_d10, 4), 620 + GROUP(lcd_d11, 4), 621 + GROUP(lcd_d12, 4), 622 + GROUP(lcd_d13, 4), 623 + GROUP(lcd_d14, 4), 624 + GROUP(lcd_d15, 4), 625 + GROUP(lcd_vs, 4), 626 + GROUP(lcd_hs, 4), 627 + GROUP(lcd_den, 4), 628 + GROUP(lcd_d16, 4), 629 + GROUP(lcd_clk_x, 4), 630 + GROUP(lcd_d17, 4), 631 + 632 + /* Bank X func5 */ 633 + GROUP(pwm_g_x0, 5), 634 + GROUP(pwm_h_x1, 5), 635 + GROUP(pwm_i_x2, 5), 636 + GROUP(pwm_j_x3, 5), 637 + GROUP(pwm_k_x4, 5), 638 + GROUP(pwm_l_x, 5), 639 + GROUP(pwm_m_x, 5), 640 + GROUP(pwm_n_x, 5), 641 + GROUP(pwm_g_x8, 5), 642 + GROUP(pwm_h_x9, 5), 643 + GROUP(pwm_i_x10, 5), 644 + GROUP(clk12_24_x11, 5), 645 + 646 + /* Bank X func6 */ 647 + GROUP(uart_a_rx_x, 6), 648 + GROUP(uart_a_tx_x, 6), 649 + GROUP(uart_c_rx_x, 6), 650 + GROUP(uart_c_tx_x, 6), 651 + GROUP(i2c3_sda_x, 6), 652 + GROUP(i2c3_scl_x, 6), 653 + GROUP(i2c1_sda_x, 6), 654 + GROUP(i2c1_scl_x, 6), 655 + GROUP(uart_d_tx_x, 6), 656 + GROUP(uart_d_rx_x, 6), 657 + 658 + /* Bank D func1 */ 659 + GROUP(pwm_g_d, 1), 660 + GROUP(pwm_h_d, 1), 661 + GROUP(eth_led_act, 1), 662 + GROUP(eth_led_link, 1), 663 + GROUP(pwm_d, 1), 664 + GROUP(pwm_f, 1), 665 + GROUP(pwm_k_d, 1), 666 + 667 + /* Bank D func2 */ 668 + GROUP(uart_a_tx_d, 2), 669 + GROUP(uart_a_rx_d, 2), 670 + GROUP(spi_b_miso_d, 2), 671 + GROUP(spi_b_clk_d, 2), 672 + GROUP(spi_b_mosi_d, 2), 673 + GROUP(spi_b_ss0_d, 2), 674 + GROUP(spi_b_ss1_d, 2), 675 + 676 + /* Bank D func3 */ 677 + GROUP(i2c0_sda_d, 3), 678 + GROUP(i2c0_scl_d, 3), 679 + GROUP(i2c1_sda_d, 3), 680 + GROUP(i2c1_scl_d, 3), 681 + GROUP(pdm_dclk_d, 3), 682 + GROUP(pdm_din0_d, 3), 683 + GROUP(ir_in_d6, 3), 684 + 685 + /* Bank D func4 */ 686 + GROUP(ir_in_d0, 4), 687 + GROUP(ir_out, 4), 688 + GROUP(pwm_i_d, 4), 689 + GROUP(pwm_j_d, 4), 690 + GROUP(i2c3_sda_d, 4), 691 + GROUP(i2c3_scl_d, 4), 692 + 693 + /* Bank D func5 */ 694 + GROUP(tdm_fs0_d, 5), 695 + GROUP(tdm_sclk0_d, 5), 696 + GROUP(mclk_0_d, 5), 697 + GROUP(tdm_d1_d, 5), 698 + GROUP(tdm_d0_d, 5), 699 + 700 + /* Bank D func6 */ 701 + GROUP(uart_d_tx_d, 6), 702 + GROUP(uart_d_rx_d, 6), 703 + GROUP(uart_c_tx_d, 6), 704 + GROUP(uart_c_rx_d, 6), 705 + 706 + /* Bank A func1 */ 707 + GROUP(uart_b_tx_a, 1), 708 + GROUP(uart_b_rx_a, 1), 709 + GROUP(pwm_c, 1), 710 + GROUP(pwm_l_a, 1), 711 + GROUP(i2c1_sda_a, 1), 712 + GROUP(i2c1_scl_a, 1), 713 + 714 + /* Bank A func2 */ 715 + GROUP(pwm_c_hiz, 2), 716 + GROUP(gen_clk_a, 2), 717 + GROUP(pdm_dclk_z, 2), 718 + GROUP(pdm_din0_a, 2), 719 + 720 + /* Bank A func3 */ 721 + GROUP(jtag_a_clk, 3), 722 + GROUP(jtag_a_tms, 3), 723 + GROUP(jtag_a_tdi, 3), 724 + GROUP(jtag_a_tdo, 3), 725 + 726 + /* Bank A func4 */ 727 + GROUP(lcd_clk_a, 4), 728 + GROUP(uart_f_tx_a, 4), 729 + GROUP(uart_f_rx_a, 4), 730 + 731 + /* Bank A func5 */ 732 + GROUP(uart_e_tx_a, 5), 733 + GROUP(uart_e_rx_a, 5), 734 + GROUP(pwm_m_a, 5), 735 + GROUP(pwm_n_a, 5), 736 + 737 + /* Bank A func6 */ 738 + GROUP(spi_a_mosi_a, 6), 739 + GROUP(gen_clk_a4, 6), 740 + GROUP(clk12_24_a, 6), 741 + }; 742 + 743 + static const char * const gpio_periphs_groups[] = { 744 + "GPIO_TEST_N", 745 + 746 + "GPIOE_0", "GPIOE_1", "GPIOE_2", "GPIOE_3", "GPIOE_4", 747 + 748 + "GPIOB_0", "GPIOB_1", "GPIOB_2", "GPIOB_3", "GPIOB_4", 749 + "GPIOB_5", "GPIOB_6", "GPIOB_7", "GPIOB_8", "GPIOB_9", 750 + "GPIOB_10", "GPIOB_11", "GPIOB_12", "GPIOB_13", 751 + "GPIOB_14", 752 + 753 + "GPIOC_0", "GPIOC_1", "GPIOC_2", "GPIOC_3", "GPIOC_4", 754 + "GPIOC_5", "GPIOC_6", 755 + 756 + "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4", 757 + "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9", 758 + "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", 759 + 760 + "GPIOD_0", "GPIOD_1", "GPIOD_2", "GPIOD_3", "GPIOD_4", 761 + "GPIOD_5", "GPIOD_6", 762 + 763 + "GPIOA_0", "GPIOA_1", "GPIOA_2", "GPIOA_3", "GPIOA_4", 764 + "GPIOA_5", 765 + }; 766 + 767 + static const char * const uart_a_groups[] = { 768 + "uart_a_tx_b", "uart_a_rx_b", "uart_a_cts_b", "uart_a_rts_b", 769 + "uart_a_rx_c", "uart_a_tx_c", "uart_a_rx_x", "uart_a_tx_x", 770 + "uart_a_tx_d", "uart_a_rx_d", 771 + }; 772 + 773 + static const char * const uart_b_groups[] = { 774 + "uart_b_rx_c", "uart_b_tx_c", "uart_b_tx_a", "uart_b_rx_a", 775 + }; 776 + 777 + static const char * const uart_c_groups[] = { 778 + "uart_c_rx_c", "uart_c_tx_c", 779 + "uart_c_rx_x", "uart_c_tx_x", 780 + "uart_c_tx_d", "uart_c_rx_d", 781 + }; 782 + 783 + static const char * const uart_d_groups[] = { 784 + "uart_d_tx_b", "uart_d_rx_b", "uart_d_tx_d", "uart_d_rx_d", 785 + "uart_d_rx_x", "uart_d_tx_x", 786 + }; 787 + 788 + static const char * const uart_e_groups[] = { 789 + "uart_e_cts", "uart_e_tx_x", "uart_e_rx_x", "uart_e_rts", 790 + "uart_e_tx_a", "uart_e_rx_a", 791 + }; 792 + 793 + static const char * const i2c0_groups[] = { 794 + "i2c0_sda_e", "i2c0_scl_e", 795 + "i2c0_sda_d", "i2c0_scl_d", 796 + }; 797 + 798 + static const char * const i2c1_groups[] = { 799 + "i2c1_sda_x", "i2c1_scl_x", 800 + "i2c1_sda_d", "i2c1_scl_d", 801 + "i2c1_sda_a", "i2c1_scl_a", 802 + "i2c1_sda_b", "i2c1_scl_b", 803 + }; 804 + 805 + static const char * const i2c2_groups[] = { 806 + "i2c2_sda", "i2c2_scl", 807 + }; 808 + 809 + static const char * const i2c3_groups[] = { 810 + "i2c3_sda_c", "i2c3_scl_c", 811 + "i2c3_sda_x", "i2c3_scl_x", 812 + "i2c3_sda_d", "i2c3_scl_d", 813 + }; 814 + 815 + static const char * const i2c_slave_groups[] = { 816 + "i2c_slave_scl", "i2c_slave_sda", 817 + }; 818 + 819 + static const char * const pwm_a_groups[] = { 820 + "pwm_a", 821 + }; 822 + 823 + static const char * const pwm_b_groups[] = { 824 + "pwm_b", 825 + }; 826 + 827 + static const char * const pwm_c_groups[] = { 828 + "pwm_c", 829 + }; 830 + 831 + static const char * const pwm_d_groups[] = { 832 + "pwm_d", 833 + }; 834 + 835 + static const char * const pwm_e_groups[] = { 836 + "pwm_e", 837 + }; 838 + 839 + static const char * const pwm_f_groups[] = { 840 + "pwm_f", 841 + }; 842 + 843 + static const char * const pwm_g_groups[] = { 844 + "pwm_g_b", "pwm_g_c", "pwm_g_d", "pwm_g_x0", "pwm_g_x8", 845 + }; 846 + 847 + static const char * const pwm_h_groups[] = { 848 + "pwm_h_b", "pwm_h_c", "pwm_h_d", "pwm_h_x1", "pwm_h_x9", 849 + }; 850 + 851 + static const char * const pwm_i_groups[] = { 852 + "pwm_i_b", "pwm_i_c", "pwm_i_d", "pwm_i_x2", "pwm_i_x10", 853 + }; 854 + 855 + static const char * const pwm_j_groups[] = { 856 + "pwm_j_c", "pwm_j_d", "pwm_j_b", "pwm_j_x3", "pwm_j_x12", 857 + }; 858 + 859 + static const char * const pwm_k_groups[] = { 860 + "pwm_k_c", "pwm_k_d", "pwm_k_b", "pwm_k_x4", "pwm_k_x13", 861 + }; 862 + 863 + static const char * const pwm_l_groups[] = { 864 + "pwm_l_c", "pwm_l_x", "pwm_l_b", "pwm_l_a", 865 + }; 866 + 867 + static const char * const pwm_m_groups[] = { 868 + "pwm_m_c", "pwm_m_x", "pwm_m_a", "pwm_m_b", 869 + }; 870 + 871 + static const char * const pwm_n_groups[] = { 872 + "pwm_n_x", "pwm_n_a", "pwm_n_b", 873 + }; 874 + 875 + static const char * const pwm_c_hiz_groups[] = { 876 + "pwm_c_hiz", 877 + }; 878 + 879 + static const char * const ir_out_groups[] = { 880 + "ir_out", 881 + }; 882 + 883 + static const char * const ir_in_groups[] = { 884 + "ir_in_d0", "ir_in_d6", 885 + }; 886 + 887 + static const char * const jtag_a_groups[] = { 888 + "jtag_a_clk", "jtag_a_tms", "jtag_a_tdi", "jtag_a_tdo", 889 + }; 890 + 891 + static const char * const jtag_b_groups[] = { 892 + "jtag_b_tdo", "jtag_b_tdi", "jtag_b_clk", "jtag_b_tms", 893 + }; 894 + 895 + static const char * const gen_clk_groups[] = { 896 + "gen_clk_e", "gen_clk_c", "gen_clk_a", "gen_clk_x", 897 + "gen_clk_a4", 898 + }; 899 + 900 + static const char * const clk12_24_groups[] = { 901 + "clk12_24_e", "clk12_24_c", "clk12_24_x", "clk12_24_a", 902 + "clk12_24_x13", "clk12_24_x11", 903 + }; 904 + 905 + static const char * const clk_32k_in_groups[] = { 906 + "clk_32k_in", 907 + }; 908 + 909 + static const char * const emmc_groups[] = { 910 + "emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2", "emmc_nand_d3", 911 + "emmc_nand_d4", "emmc_nand_d5", "emmc_nand_d6", "emmc_nand_d7", 912 + "emmc_clk", "emmc_rst", "emmc_cmd", "emmc_nand_ds", 913 + }; 914 + 915 + static const char * const nand_groups[] = { 916 + "emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2", "emmc_nand_d3", 917 + "emmc_nand_d4", "emmc_nand_d5", "emmc_nand_d6", "emmc_nand_d7", 918 + "emmc_clk", "emmc_rst", "emmc_cmd", "emmc_nand_ds", 919 + "nand_wen_clk", "nand_ale", "nand_ren_wr", "nand_cle", 920 + "nand_ce0", 921 + }; 922 + 923 + static const char * const spif_groups[] = { 924 + "spif_mo", "spif_mi", "spif_wp", "spif_cs", 925 + "spif_clk", "spif_hold", "spif_clk_loop", 926 + }; 927 + 928 + static const char * const spi_a_groups[] = { 929 + "spi_a_clk_b", "spi_a_ss0_b", "spi_a_ss1_b", "spi_a_ss2_b", 930 + "spi_a_mosi_b", "spi_a_miso_b", 931 + 932 + "spi_a_clk_c", "spi_a_ss0_c", "spi_a_ss1_c", 933 + "spi_a_mosi_c", "spi_a_miso_c", 934 + 935 + "spi_a_clk_x", "spi_a_ss0_x", "spi_a_ss1_x", "spi_a_ss2_x", 936 + "spi_a_mosi_x", "spi_a_miso_x", 937 + "spi_a_mosi_a", 938 + }; 939 + 940 + static const char * const spi_b_groups[] = { 941 + "spi_b_clk_x", "spi_b_ss0_x", "spi_b_ss1_x", "spi_b_ss2_x6", 942 + "spi_b_miso_x", "spi_b_mosi_x", "spi_b_ss2_x12", 943 + 944 + "spi_b_clk_d", "spi_b_ss0_d", "spi_b_ss1_d", "spi_b_miso_d", 945 + "spi_b_mosi_d", 946 + }; 947 + 948 + static const char * const sdcard_groups[] = { 949 + "sdcard_d0", "sdcard_d1", "sdcard_d2", "sdcard_d3", 950 + "sdcard_cd", "sdcard_clk", "sdcard_cmd", 951 + }; 952 + 953 + static const char * const sdio_groups[] = { 954 + "sdio_d0", "sdio_d1", "sdio_d2", "sdio_d3", 955 + "sdio_clk", "sdio_cmd", 956 + }; 957 + 958 + static const char * const pdm_groups[] = { 959 + "pdm_dclk_c", "pdm_din0_c", "pdm_dclk_d", "pdm_din0_d", 960 + "pdm_dclk_z", "pdm_din0_a", "pdm_dclk_b", "pdm_din0_b", 961 + "pdm_dclk_x5", "pdm_din0_x6", "pdm_din0_x9", "pdm_dclk_x10", 962 + }; 963 + 964 + static const char * const eth_groups[] = { 965 + "eth_led_act", "eth_led_link", 966 + }; 967 + 968 + static const char * const mclk_0_groups[] = { 969 + "mclk_0_x", "mclk_0_d", 970 + }; 971 + 972 + static const char * const mclk_1_groups[] = { 973 + "mclk_1", 974 + }; 975 + 976 + static const char * const tdm_groups[] = { 977 + "tdm_d3", "tdm_d2", "tdm_fs1", "tdm_d1_x", "tdm_d0_x", 978 + "tdm_d1_d", "tdm_d0_d", "tdm_sclk1", "tdm_fs0_x", "tdm_fs0_d", 979 + "tdm_sclk0_x", "tdm_sclk0_d", 980 + }; 981 + 982 + static const char * const lcd_groups[] = { 983 + "lcd_d0", "lcd_d1", "lcd_d2", "lcd_d3", "lcd_d4", 984 + "lcd_d5", "lcd_d6", "lcd_d7", "lcd_d8", "lcd_d9", 985 + "lcd_d10", "lcd_d11", "lcd_d12", "lcd_d13", "lcd_d14", 986 + "lcd_d15", "lcd_d16", "lcd_d17", "lcd_den", 987 + "lcd_clk_a", "lcd_clk_x", "lcd_hs", "lcd_vs", 988 + }; 989 + 990 + static struct meson_pmx_func c3_periphs_functions[] = { 991 + FUNCTION(gpio_periphs), 992 + FUNCTION(uart_a), 993 + FUNCTION(uart_b), 994 + FUNCTION(uart_c), 995 + FUNCTION(uart_d), 996 + FUNCTION(uart_e), 997 + FUNCTION(i2c0), 998 + FUNCTION(i2c1), 999 + FUNCTION(i2c2), 1000 + FUNCTION(i2c3), 1001 + FUNCTION(i2c_slave), 1002 + FUNCTION(pwm_a), 1003 + FUNCTION(pwm_b), 1004 + FUNCTION(pwm_c), 1005 + FUNCTION(pwm_d), 1006 + FUNCTION(pwm_e), 1007 + FUNCTION(pwm_f), 1008 + FUNCTION(pwm_g), 1009 + FUNCTION(pwm_h), 1010 + FUNCTION(pwm_i), 1011 + FUNCTION(pwm_j), 1012 + FUNCTION(pwm_k), 1013 + FUNCTION(pwm_l), 1014 + FUNCTION(pwm_m), 1015 + FUNCTION(pwm_n), 1016 + FUNCTION(pwm_c_hiz), 1017 + FUNCTION(ir_out), 1018 + FUNCTION(ir_in), 1019 + FUNCTION(jtag_a), 1020 + FUNCTION(jtag_b), 1021 + FUNCTION(gen_clk), 1022 + FUNCTION(clk12_24), 1023 + FUNCTION(clk_32k_in), 1024 + FUNCTION(emmc), 1025 + FUNCTION(nand), 1026 + FUNCTION(spif), 1027 + FUNCTION(spi_a), 1028 + FUNCTION(spi_b), 1029 + FUNCTION(sdcard), 1030 + FUNCTION(sdio), 1031 + FUNCTION(pdm), 1032 + FUNCTION(eth), 1033 + FUNCTION(mclk_0), 1034 + FUNCTION(mclk_1), 1035 + FUNCTION(tdm), 1036 + FUNCTION(lcd), 1037 + }; 1038 + 1039 + static struct meson_bank c3_periphs_banks[] = { 1040 + /* name first last irq pullen pull dir out in ds */ 1041 + BANK_DS("X", GPIOX_0, GPIOX_13, 40, 53, 1042 + 0x03, 0, 0x04, 0, 0x02, 0, 0x01, 0, 0x00, 0, 0x07, 0), 1043 + BANK_DS("D", GPIOD_0, GPIOD_6, 33, 39, 1044 + 0x23, 0, 0x24, 0, 0x22, 0, 0x21, 0, 0x20, 0, 0x27, 0), 1045 + BANK_DS("E", GPIOE_0, GPIOE_4, 22, 26, 1046 + 0x33, 0, 0x34, 0, 0x32, 0, 0x31, 0, 0x30, 0, 0x37, 0), 1047 + BANK_DS("C", GPIOC_0, GPIOC_6, 15, 21, 1048 + 0x43, 0, 0x44, 0, 0x42, 0, 0x41, 0, 0x40, 0, 0x47, 0), 1049 + BANK_DS("B", GPIOB_0, GPIOB_14, 0, 14, 1050 + 0x53, 0, 0x54, 0, 0x52, 0, 0x51, 0, 0x50, 0, 0x57, 0), 1051 + BANK_DS("A", GPIOA_0, GPIOA_5, 27, 32, 1052 + 0x63, 0, 0x64, 0, 0x62, 0, 0x61, 0, 0x60, 0, 0x67, 0), 1053 + BANK_DS("TEST_N", GPIO_TEST_N, GPIO_TEST_N, 54, 54, 1054 + 0x73, 0, 0x74, 0, 0x72, 0, 0x71, 0, 0x70, 0, 0x77, 0), 1055 + }; 1056 + 1057 + static struct meson_pmx_bank c3_periphs_pmx_banks[] = { 1058 + /* name first last reg offset */ 1059 + BANK_PMX("B", GPIOB_0, GPIOB_14, 0x00, 0), 1060 + BANK_PMX("X", GPIOX_0, GPIOX_13, 0x03, 0), 1061 + BANK_PMX("C", GPIOC_0, GPIOC_6, 0x09, 0), 1062 + BANK_PMX("A", GPIOA_0, GPIOA_5, 0x0b, 0), 1063 + BANK_PMX("D", GPIOD_0, GPIOD_6, 0x10, 0), 1064 + BANK_PMX("E", GPIOE_0, GPIOE_4, 0x12, 0), 1065 + BANK_PMX("TEST_N", GPIO_TEST_N, GPIO_TEST_N, 0x02, 0), 1066 + }; 1067 + 1068 + static struct meson_axg_pmx_data c3_periphs_pmx_banks_data = { 1069 + .pmx_banks = c3_periphs_pmx_banks, 1070 + .num_pmx_banks = ARRAY_SIZE(c3_periphs_pmx_banks), 1071 + }; 1072 + 1073 + static struct meson_pinctrl_data c3_periphs_pinctrl_data = { 1074 + .name = "periphs-banks", 1075 + .pins = c3_periphs_pins, 1076 + .groups = c3_periphs_groups, 1077 + .funcs = c3_periphs_functions, 1078 + .banks = c3_periphs_banks, 1079 + .num_pins = ARRAY_SIZE(c3_periphs_pins), 1080 + .num_groups = ARRAY_SIZE(c3_periphs_groups), 1081 + .num_funcs = ARRAY_SIZE(c3_periphs_functions), 1082 + .num_banks = ARRAY_SIZE(c3_periphs_banks), 1083 + .pmx_ops = &meson_axg_pmx_ops, 1084 + .pmx_data = &c3_periphs_pmx_banks_data, 1085 + .parse_dt = &meson_a1_parse_dt_extra, 1086 + }; 1087 + 1088 + static const struct of_device_id c3_pinctrl_dt_match[] = { 1089 + { 1090 + .compatible = "amlogic,c3-periphs-pinctrl", 1091 + .data = &c3_periphs_pinctrl_data, 1092 + }, 1093 + { } 1094 + }; 1095 + MODULE_DEVICE_TABLE(of, c3_pinctrl_dt_match); 1096 + 1097 + static struct platform_driver c3_pinctrl_driver = { 1098 + .probe = meson_pinctrl_probe, 1099 + .driver = { 1100 + .name = "amlogic-c3-pinctrl", 1101 + .of_match_table = c3_pinctrl_dt_match, 1102 + }, 1103 + }; 1104 + module_platform_driver(c3_pinctrl_driver); 1105 + 1106 + MODULE_AUTHOR("Huqiang Qin <huqiang.qin@amlogic.com>"); 1107 + MODULE_DESCRIPTION("Pin controller and GPIO driver for Amlogic C3 SoC"); 1108 + MODULE_LICENSE("Dual BSD/GPL");
+1 -2
drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c
··· 1 + // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 1 2 /* 2 3 * Second generation of pinmux driver for Amlogic Meson-AXG SoC. 3 4 * ··· 7 6 * 8 7 * Copyright (c) 2017 Amlogic, Inc. All rights reserved. 9 8 * Author: Xingyu Chen <xingyu.chen@amlogic.com> 10 - * 11 - * SPDX-License-Identifier: (GPL-2.0+ or MIT) 12 9 */ 13 10 14 11 /*
+1 -1
drivers/pinctrl/meson/pinctrl-meson-axg-pmx.h
··· 1 - /* SPDX-License-Identifier: (GPL-2.0+ or MIT) */ 1 + /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ 2 2 /* 3 3 * Copyright (c) 2017 Baylibre SAS. 4 4 * Author: Jerome Brunet <jbrunet@baylibre.com>
+1 -2
drivers/pinctrl/meson/pinctrl-meson-axg.c
··· 1 + // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 1 2 /* 2 3 * Pin controller and GPIO driver for Amlogic Meson AXG SoC. 3 4 * 4 5 * Copyright (c) 2017 Amlogic, Inc. All rights reserved. 5 6 * Author: Xingyu Chen <xingyu.chen@amlogic.com> 6 - * 7 - * SPDX-License-Identifier: (GPL-2.0+ or MIT) 8 7 */ 9 8 10 9 #include <dt-bindings/gpio/meson-axg-gpio.h>
+19 -18
drivers/pinctrl/meson/pinctrl-meson-g12a.c
··· 1 - // SPDX-License-Identifier: (GPL-2.0+ or MIT) 1 + // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 2 /* 3 3 * Pin controller and GPIO driver for Amlogic Meson G12A SoC. 4 4 * ··· 8 8 */ 9 9 10 10 #include <dt-bindings/gpio/meson-g12a-gpio.h> 11 + #include <dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h> 11 12 #include "pinctrl-meson.h" 12 13 #include "pinctrl-meson-axg-pmx.h" 13 14 ··· 1319 1318 1320 1319 static struct meson_bank meson_g12a_periphs_banks[] = { 1321 1320 /* name first last irq pullen pull dir out in ds */ 1322 - BANK_DS("Z", GPIOZ_0, GPIOZ_15, 12, 27, 1323 - 4, 0, 4, 0, 12, 0, 13, 0, 14, 0, 5, 0), 1324 - BANK_DS("H", GPIOH_0, GPIOH_8, 28, 36, 1325 - 3, 0, 3, 0, 9, 0, 10, 0, 11, 0, 4, 0), 1326 - BANK_DS("BOOT", BOOT_0, BOOT_15, 37, 52, 1327 - 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0), 1328 - BANK_DS("C", GPIOC_0, GPIOC_7, 53, 60, 1329 - 1, 0, 1, 0, 3, 0, 4, 0, 5, 0, 1, 0), 1330 - BANK_DS("A", GPIOA_0, GPIOA_15, 61, 76, 1331 - 5, 0, 5, 0, 16, 0, 17, 0, 18, 0, 6, 0), 1332 - BANK_DS("X", GPIOX_0, GPIOX_19, 77, 96, 1333 - 2, 0, 2, 0, 6, 0, 7, 0, 8, 0, 2, 0), 1321 + BANK_DS("Z", GPIOZ_0, GPIOZ_15, IRQID_GPIOZ_0, IRQID_GPIOZ_15, 1322 + 4, 0, 4, 0, 12, 0, 13, 0, 14, 0, 5, 0), 1323 + BANK_DS("H", GPIOH_0, GPIOH_8, IRQID_GPIOH_0, IRQID_GPIOH_8, 1324 + 3, 0, 3, 0, 9, 0, 10, 0, 11, 0, 4, 0), 1325 + BANK_DS("BOOT", BOOT_0, BOOT_15, IRQID_BOOT_0, IRQID_BOOT_15, 1326 + 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0), 1327 + BANK_DS("C", GPIOC_0, GPIOC_7, IRQID_GPIOC_0, IRQID_GPIOC_7, 1328 + 1, 0, 1, 0, 3, 0, 4, 0, 5, 0, 1, 0), 1329 + BANK_DS("A", GPIOA_0, GPIOA_15, IRQID_GPIOA_0, IRQID_GPIOA_15, 1330 + 5, 0, 5, 0, 16, 0, 17, 0, 18, 0, 6, 0), 1331 + BANK_DS("X", GPIOX_0, GPIOX_19, IRQID_GPIOX_0, IRQID_GPIOX_19, 1332 + 2, 0, 2, 0, 6, 0, 7, 0, 8, 0, 2, 0), 1334 1333 }; 1335 1334 1336 1335 static struct meson_bank meson_g12a_aobus_banks[] = { 1337 1336 /* name first last irq pullen pull dir out in ds */ 1338 - BANK_DS("AO", GPIOAO_0, GPIOAO_11, 0, 11, 3, 0, 2, 0, 0, 0, 4, 0, 1, 0, 1339 - 0, 0), 1337 + BANK_DS("AO", GPIOAO_0, GPIOAO_11, IRQID_GPIOAO_0, IRQID_GPIOAO_11, 1338 + 3, 0, 2, 0, 0, 0, 4, 0, 1, 0, 0, 0), 1340 1339 /* GPIOE actually located in the AO bank */ 1341 - BANK_DS("E", GPIOE_0, GPIOE_2, 97, 99, 3, 16, 2, 16, 0, 16, 4, 16, 1, 1342 - 16, 1, 0), 1340 + BANK_DS("E", GPIOE_0, GPIOE_2, IRQID_GPIOE_0, IRQID_GPIOE_2, 1341 + 3, 16, 2, 16, 0, 16, 4, 16, 1, 16, 1, 0), 1343 1342 }; 1344 1343 1345 1344 static struct meson_pmx_bank meson_g12a_periphs_pmx_banks[] = { 1346 - /* name first lask reg offset */ 1345 + /* name first last reg offset */ 1347 1346 BANK_PMX("Z", GPIOZ_0, GPIOZ_15, 0x6, 0), 1348 1347 BANK_PMX("H", GPIOH_0, GPIOH_8, 0xb, 0), 1349 1348 BANK_PMX("BOOT", BOOT_0, BOOT_15, 0x0, 0),
-1
drivers/pinctrl/meson/pinctrl-meson.c
··· 43 43 #include <linux/io.h> 44 44 #include <linux/of.h> 45 45 #include <linux/of_address.h> 46 - #include <linux/of_device.h> 47 46 #include <linux/pinctrl/pinconf-generic.h> 48 47 #include <linux/pinctrl/pinconf.h> 49 48 #include <linux/pinctrl/pinctrl.h>
-1
drivers/pinctrl/mvebu/pinctrl-ac5.c
··· 12 12 #include <linux/io.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/of.h> 15 - #include <linux/of_device.h> 16 15 #include <linux/pinctrl/pinctrl.h> 17 16 18 17 #include "pinctrl-mvebu.h"
-1
drivers/pinctrl/mvebu/pinctrl-armada-370.c
··· 13 13 #include <linux/platform_device.h> 14 14 #include <linux/clk.h> 15 15 #include <linux/of.h> 16 - #include <linux/of_device.h> 17 16 #include <linux/pinctrl/pinctrl.h> 18 17 19 18 #include "pinctrl-mvebu.h"
-1
drivers/pinctrl/mvebu/pinctrl-armada-375.c
··· 13 13 #include <linux/platform_device.h> 14 14 #include <linux/clk.h> 15 15 #include <linux/of.h> 16 - #include <linux/of_device.h> 17 16 #include <linux/pinctrl/pinctrl.h> 18 17 19 18 #include "pinctrl-mvebu.h"
+3 -13
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
··· 13 13 #include <linux/gpio/driver.h> 14 14 #include <linux/mfd/syscon.h> 15 15 #include <linux/of.h> 16 - #include <linux/of_address.h> 17 - #include <linux/of_device.h> 18 16 #include <linux/of_irq.h> 19 17 #include <linux/pinctrl/pinconf-generic.h> 20 18 #include <linux/pinctrl/pinconf.h> ··· 1011 1013 return 0; 1012 1014 } 1013 1015 1014 - #if defined(CONFIG_PM) 1015 1016 static int armada_3700_pinctrl_suspend(struct device *dev) 1016 1017 { 1017 1018 struct armada_37xx_pinctrl *info = dev_get_drvdata(dev); ··· 1104 1107 * Since pinctrl is an infrastructure module, its resume should be issued prior 1105 1108 * to other IO drivers. 1106 1109 */ 1107 - static const struct dev_pm_ops armada_3700_pinctrl_pm_ops = { 1108 - .suspend_noirq = armada_3700_pinctrl_suspend, 1109 - .resume_noirq = armada_3700_pinctrl_resume, 1110 - }; 1111 - 1112 - #define PINCTRL_ARMADA_37XX_DEV_PM_OPS (&armada_3700_pinctrl_pm_ops) 1113 - #else 1114 - #define PINCTRL_ARMADA_37XX_DEV_PM_OPS NULL 1115 - #endif /* CONFIG_PM */ 1110 + static DEFINE_NOIRQ_DEV_PM_OPS(armada_3700_pinctrl_pm_ops, 1111 + armada_3700_pinctrl_suspend, armada_3700_pinctrl_resume); 1116 1112 1117 1113 static const struct of_device_id armada_37xx_pinctrl_of_match[] = { 1118 1114 { ··· 1172 1182 .driver = { 1173 1183 .name = "armada-37xx-pinctrl", 1174 1184 .of_match_table = armada_37xx_pinctrl_of_match, 1175 - .pm = PINCTRL_ARMADA_37XX_DEV_PM_OPS, 1185 + .pm = pm_sleep_ptr(&armada_3700_pinctrl_pm_ops), 1176 1186 }, 1177 1187 }; 1178 1188
+1 -2
drivers/pinctrl/mvebu/pinctrl-dove.c
··· 784 784 } 785 785 clk_prepare_enable(clk); 786 786 787 - mpp_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 788 - base = devm_ioremap_resource(&pdev->dev, mpp_res); 787 + base = devm_platform_get_and_ioremap_resource(pdev, 0, &mpp_res); 789 788 if (IS_ERR(base)) 790 789 return PTR_ERR(base); 791 790
-2
drivers/pinctrl/mvebu/pinctrl-mvebu.c
··· 11 11 #include <linux/io.h> 12 12 #include <linux/mfd/syscon.h> 13 13 #include <linux/of.h> 14 - #include <linux/of_address.h> 15 - #include <linux/of_platform.h> 16 14 #include <linux/platform_device.h> 17 15 #include <linux/regmap.h> 18 16 #include <linux/seq_file.h>
+1 -1
drivers/pinctrl/nxp/pinctrl-s32cc.c
··· 14 14 #include <linux/io.h> 15 15 #include <linux/module.h> 16 16 #include <linux/of.h> 17 - #include <linux/of_device.h> 17 + #include <linux/platform_device.h> 18 18 #include <linux/pinctrl/machine.h> 19 19 #include <linux/pinctrl/pinconf.h> 20 20 #include <linux/pinctrl/pinctrl.h>
+1 -1
drivers/pinctrl/nxp/pinctrl-s32g2.c
··· 12 12 #include <linux/io.h> 13 13 #include <linux/module.h> 14 14 #include <linux/of.h> 15 - #include <linux/of_device.h> 15 + #include <linux/platform_device.h> 16 16 #include <linux/pinctrl/pinctrl.h> 17 17 18 18 #include "pinctrl-s32.h"
+2 -2
drivers/pinctrl/pinctrl-amd.c
··· 748 748 break; 749 749 750 750 default: 751 - dev_err(&gpio_dev->pdev->dev, "Invalid config param %04x\n", 751 + dev_dbg(&gpio_dev->pdev->dev, "Invalid config param %04x\n", 752 752 param); 753 753 return -ENOTSUPP; 754 754 } ··· 798 798 break; 799 799 800 800 default: 801 - dev_err(&gpio_dev->pdev->dev, 801 + dev_dbg(&gpio_dev->pdev->dev, 802 802 "Invalid config param %04x\n", param); 803 803 ret = -ENOTSUPP; 804 804 }
+3 -4
drivers/pinctrl/pinctrl-at91-pio4.c
··· 939 939 if (!atmel_pioctrl->pins[pin_id]->device) 940 940 return; 941 941 942 - if (atmel_pioctrl->pins[pin_id]) 943 - seq_printf(s, " (%s, ioset %u) ", 944 - atmel_pioctrl->pins[pin_id]->device, 945 - atmel_pioctrl->pins[pin_id]->ioset); 942 + seq_printf(s, " (%s, ioset %u) ", 943 + atmel_pioctrl->pins[pin_id]->device, 944 + atmel_pioctrl->pins[pin_id]->ioset); 946 945 947 946 conf = atmel_pin_config_read(pctldev, pin_id); 948 947 if (conf & ATMEL_PIO_PUEN_MASK)
+4 -6
drivers/pinctrl/pinctrl-at91.c
··· 1657 1657 return 0; 1658 1658 } 1659 1659 1660 - static int __maybe_unused at91_gpio_suspend(struct device *dev) 1660 + static int at91_gpio_suspend(struct device *dev) 1661 1661 { 1662 1662 struct at91_gpio_chip *at91_chip = dev_get_drvdata(dev); 1663 1663 void __iomem *pio = at91_chip->regbase; ··· 1675 1675 return 0; 1676 1676 } 1677 1677 1678 - static int __maybe_unused at91_gpio_resume(struct device *dev) 1678 + static int at91_gpio_resume(struct device *dev) 1679 1679 { 1680 1680 struct at91_gpio_chip *at91_chip = dev_get_drvdata(dev); 1681 1681 void __iomem *pio = at91_chip->regbase; ··· 1903 1903 return 0; 1904 1904 } 1905 1905 1906 - static const struct dev_pm_ops at91_gpio_pm_ops = { 1907 - NOIRQ_SYSTEM_SLEEP_PM_OPS(at91_gpio_suspend, at91_gpio_resume) 1908 - }; 1906 + static DEFINE_NOIRQ_DEV_PM_OPS(at91_gpio_pm_ops, at91_gpio_suspend, at91_gpio_resume); 1909 1907 1910 1908 static struct platform_driver at91_gpio_driver = { 1911 1909 .driver = { 1912 1910 .name = "gpio-at91", 1913 1911 .of_match_table = at91_gpio_of_match, 1914 - .pm = pm_ptr(&at91_gpio_pm_ops), 1912 + .pm = pm_sleep_ptr(&at91_gpio_pm_ops), 1915 1913 }, 1916 1914 .probe = at91_gpio_probe, 1917 1915 };
-1
drivers/pinctrl/pinctrl-axp209.c
··· 15 15 #include <linux/mfd/axp20x.h> 16 16 #include <linux/module.h> 17 17 #include <linux/of.h> 18 - #include <linux/of_device.h> 19 18 #include <linux/platform_device.h> 20 19 #include <linux/regmap.h> 21 20 #include <linux/slab.h>
+15
drivers/pinctrl/pinctrl-cy8c95x0.c
··· 164 164 struct pinctrl_desc pinctrl_desc; 165 165 char name[32]; 166 166 unsigned int tpin; 167 + struct gpio_desc *gpio_reset; 167 168 }; 168 169 169 170 static const struct pinctrl_pin_desc cy8c9560_pins[] = { ··· 1382 1381 return ret; 1383 1382 } 1384 1383 chip->regulator = reg; 1384 + } 1385 + 1386 + /* bring the chip out of reset if reset pin is provided */ 1387 + chip->gpio_reset = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_HIGH); 1388 + if (IS_ERR(chip->gpio_reset)) { 1389 + ret = dev_err_probe(chip->dev, PTR_ERR(chip->gpio_reset), 1390 + "Failed to get GPIO 'reset'\n"); 1391 + goto err_exit; 1392 + } else if (chip->gpio_reset) { 1393 + usleep_range(1000, 2000); 1394 + gpiod_set_value_cansleep(chip->gpio_reset, 0); 1395 + usleep_range(250000, 300000); 1396 + 1397 + gpiod_set_consumer_name(chip->gpio_reset, "CY8C95X0 RESET"); 1385 1398 } 1386 1399 1387 1400 chip->regmap = devm_regmap_init_i2c(client, &cy8c95x0_i2c_regmap);
+1 -1
drivers/pinctrl/pinctrl-k210.c
··· 7 7 #include <linux/clk.h> 8 8 #include <linux/io.h> 9 9 #include <linux/mfd/syscon.h> 10 - #include <linux/of_device.h> 10 + #include <linux/of.h> 11 11 #include <linux/platform_device.h> 12 12 #include <linux/regmap.h> 13 13 #include <linux/seq_file.h>
+2 -2
drivers/pinctrl/pinctrl-lpc18xx.c
··· 12 12 #include <linux/clk.h> 13 13 #include <linux/init.h> 14 14 #include <linux/io.h> 15 - #include <linux/of.h> 16 - #include <linux/of_device.h> 15 + #include <linux/mod_devicetable.h> 16 + #include <linux/platform_device.h> 17 17 18 18 #include <linux/pinctrl/pinconf-generic.h> 19 19 #include <linux/pinctrl/pinconf.h>
+10
drivers/pinctrl/pinctrl-mcp23s08_spi.c
··· 91 91 mcp->reg_shift = 0; 92 92 mcp->chip.ngpio = 8; 93 93 mcp->chip.label = devm_kasprintf(dev, GFP_KERNEL, "mcp23s08.%d", addr); 94 + if (!mcp->chip.label) 95 + return -ENOMEM; 94 96 95 97 config = &mcp23x08_regmap; 96 98 name = devm_kasprintf(dev, GFP_KERNEL, "%d", addr); 99 + if (!name) 100 + return -ENOMEM; 101 + 97 102 break; 98 103 99 104 case MCP_TYPE_S17: 100 105 mcp->reg_shift = 1; 101 106 mcp->chip.ngpio = 16; 102 107 mcp->chip.label = devm_kasprintf(dev, GFP_KERNEL, "mcp23s17.%d", addr); 108 + if (!mcp->chip.label) 109 + return -ENOMEM; 103 110 104 111 config = &mcp23x17_regmap; 105 112 name = devm_kasprintf(dev, GFP_KERNEL, "%d", addr); 113 + if (!name) 114 + return -ENOMEM; 115 + 106 116 break; 107 117 108 118 case MCP_TYPE_S18:
+1 -15
drivers/pinctrl/pinctrl-mlxbf3.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only or BSD-3-Clause 1 + // SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause 2 2 /* Copyright (C) 2022 NVIDIA CORPORATION & AFFILIATES */ 3 3 4 4 #include <linux/bitfield.h> ··· 223 223 return 0; 224 224 } 225 225 226 - static void mlxbf3_gpio_disable_free(struct pinctrl_dev *pctldev, 227 - struct pinctrl_gpio_range *range, 228 - unsigned int offset) 229 - { 230 - struct mlxbf3_pinctrl *priv = pinctrl_dev_get_drvdata(pctldev); 231 - 232 - /* disable GPIO functionality by giving control back to hardware */ 233 - if (offset < MLXBF3_NGPIOS_GPIO0) 234 - writel(BIT(offset), priv->fw_ctrl_clr0); 235 - else 236 - writel(BIT(offset % MLXBF3_NGPIOS_GPIO0), priv->fw_ctrl_clr1); 237 - } 238 - 239 226 static const struct pinmux_ops mlxbf3_pmx_ops = { 240 227 .get_functions_count = mlxbf3_pmx_get_funcs_count, 241 228 .get_function_name = mlxbf3_pmx_get_func_name, 242 229 .get_function_groups = mlxbf3_pmx_get_groups, 243 230 .set_mux = mlxbf3_pmx_set, 244 231 .gpio_request_enable = mlxbf3_gpio_request_enable, 245 - .gpio_disable_free = mlxbf3_gpio_disable_free, 246 232 }; 247 233 248 234 static struct pinctrl_desc mlxbf3_pin_desc = {
+1 -3
drivers/pinctrl/pinctrl-ocelot.c
··· 11 11 #include <linux/interrupt.h> 12 12 #include <linux/io.h> 13 13 #include <linux/mfd/ocelot.h> 14 - #include <linux/of_device.h> 15 - #include <linux/of_irq.h> 16 - #include <linux/of_platform.h> 14 + #include <linux/of.h> 17 15 #include <linux/platform_device.h> 18 16 #include <linux/regmap.h> 19 17 #include <linux/reset.h>
-1292
drivers/pinctrl/pinctrl-oxnas.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * Oxford Semiconductor OXNAS SoC Family pinctrl driver 4 - * 5 - * Copyright (C) 2016 Neil Armstrong <narmstrong@baylibre.com> 6 - * 7 - * Based on pinctrl-pic32.c 8 - * Joshua Henderson, <joshua.henderson@microchip.com> 9 - * Copyright (C) 2015 Microchip Technology Inc. All rights reserved. 10 - */ 11 - #include <linux/gpio/driver.h> 12 - #include <linux/interrupt.h> 13 - #include <linux/io.h> 14 - #include <linux/irq.h> 15 - #include <linux/of.h> 16 - #include <linux/of_device.h> 17 - #include <linux/pinctrl/pinconf.h> 18 - #include <linux/pinctrl/pinconf-generic.h> 19 - #include <linux/pinctrl/pinctrl.h> 20 - #include <linux/pinctrl/pinmux.h> 21 - #include <linux/platform_device.h> 22 - #include <linux/slab.h> 23 - #include <linux/regmap.h> 24 - #include <linux/mfd/syscon.h> 25 - 26 - #include "pinctrl-utils.h" 27 - 28 - #define PINS_PER_BANK 32 29 - 30 - #define GPIO_BANK_START(bank) ((bank) * PINS_PER_BANK) 31 - 32 - /* OX810 Regmap Offsets */ 33 - #define PINMUX_810_PRIMARY_SEL0 0x0c 34 - #define PINMUX_810_SECONDARY_SEL0 0x14 35 - #define PINMUX_810_TERTIARY_SEL0 0x8c 36 - #define PINMUX_810_PRIMARY_SEL1 0x10 37 - #define PINMUX_810_SECONDARY_SEL1 0x18 38 - #define PINMUX_810_TERTIARY_SEL1 0x90 39 - #define PINMUX_810_PULLUP_CTRL0 0xac 40 - #define PINMUX_810_PULLUP_CTRL1 0xb0 41 - 42 - /* OX820 Regmap Offsets */ 43 - #define PINMUX_820_BANK_OFFSET 0x100000 44 - #define PINMUX_820_SECONDARY_SEL 0x14 45 - #define PINMUX_820_TERTIARY_SEL 0x8c 46 - #define PINMUX_820_QUATERNARY_SEL 0x94 47 - #define PINMUX_820_DEBUG_SEL 0x9c 48 - #define PINMUX_820_ALTERNATIVE_SEL 0xa4 49 - #define PINMUX_820_PULLUP_CTRL 0xac 50 - 51 - /* GPIO Registers */ 52 - #define INPUT_VALUE 0x00 53 - #define OUTPUT_EN 0x04 54 - #define IRQ_PENDING 0x0c 55 - #define OUTPUT_SET 0x14 56 - #define OUTPUT_CLEAR 0x18 57 - #define OUTPUT_EN_SET 0x1c 58 - #define OUTPUT_EN_CLEAR 0x20 59 - #define RE_IRQ_ENABLE 0x28 60 - #define FE_IRQ_ENABLE 0x2c 61 - 62 - struct oxnas_function { 63 - const char *name; 64 - const char * const *groups; 65 - unsigned int ngroups; 66 - }; 67 - 68 - struct oxnas_pin_group { 69 - const char *name; 70 - unsigned int pin; 71 - unsigned int bank; 72 - struct oxnas_desc_function *functions; 73 - }; 74 - 75 - struct oxnas_desc_function { 76 - const char *name; 77 - unsigned int fct; 78 - }; 79 - 80 - struct oxnas_gpio_bank { 81 - void __iomem *reg_base; 82 - struct gpio_chip gpio_chip; 83 - struct irq_chip irq_chip; 84 - unsigned int id; 85 - }; 86 - 87 - struct oxnas_pinctrl { 88 - struct regmap *regmap; 89 - struct device *dev; 90 - struct pinctrl_dev *pctldev; 91 - const struct oxnas_function *functions; 92 - unsigned int nfunctions; 93 - const struct oxnas_pin_group *groups; 94 - unsigned int ngroups; 95 - struct oxnas_gpio_bank *gpio_banks; 96 - unsigned int nbanks; 97 - }; 98 - 99 - struct oxnas_pinctrl_data { 100 - struct pinctrl_desc *desc; 101 - struct oxnas_pinctrl *pctl; 102 - }; 103 - 104 - static const struct pinctrl_pin_desc oxnas_ox810se_pins[] = { 105 - PINCTRL_PIN(0, "gpio0"), 106 - PINCTRL_PIN(1, "gpio1"), 107 - PINCTRL_PIN(2, "gpio2"), 108 - PINCTRL_PIN(3, "gpio3"), 109 - PINCTRL_PIN(4, "gpio4"), 110 - PINCTRL_PIN(5, "gpio5"), 111 - PINCTRL_PIN(6, "gpio6"), 112 - PINCTRL_PIN(7, "gpio7"), 113 - PINCTRL_PIN(8, "gpio8"), 114 - PINCTRL_PIN(9, "gpio9"), 115 - PINCTRL_PIN(10, "gpio10"), 116 - PINCTRL_PIN(11, "gpio11"), 117 - PINCTRL_PIN(12, "gpio12"), 118 - PINCTRL_PIN(13, "gpio13"), 119 - PINCTRL_PIN(14, "gpio14"), 120 - PINCTRL_PIN(15, "gpio15"), 121 - PINCTRL_PIN(16, "gpio16"), 122 - PINCTRL_PIN(17, "gpio17"), 123 - PINCTRL_PIN(18, "gpio18"), 124 - PINCTRL_PIN(19, "gpio19"), 125 - PINCTRL_PIN(20, "gpio20"), 126 - PINCTRL_PIN(21, "gpio21"), 127 - PINCTRL_PIN(22, "gpio22"), 128 - PINCTRL_PIN(23, "gpio23"), 129 - PINCTRL_PIN(24, "gpio24"), 130 - PINCTRL_PIN(25, "gpio25"), 131 - PINCTRL_PIN(26, "gpio26"), 132 - PINCTRL_PIN(27, "gpio27"), 133 - PINCTRL_PIN(28, "gpio28"), 134 - PINCTRL_PIN(29, "gpio29"), 135 - PINCTRL_PIN(30, "gpio30"), 136 - PINCTRL_PIN(31, "gpio31"), 137 - PINCTRL_PIN(32, "gpio32"), 138 - PINCTRL_PIN(33, "gpio33"), 139 - PINCTRL_PIN(34, "gpio34"), 140 - }; 141 - 142 - static const struct pinctrl_pin_desc oxnas_ox820_pins[] = { 143 - PINCTRL_PIN(0, "gpio0"), 144 - PINCTRL_PIN(1, "gpio1"), 145 - PINCTRL_PIN(2, "gpio2"), 146 - PINCTRL_PIN(3, "gpio3"), 147 - PINCTRL_PIN(4, "gpio4"), 148 - PINCTRL_PIN(5, "gpio5"), 149 - PINCTRL_PIN(6, "gpio6"), 150 - PINCTRL_PIN(7, "gpio7"), 151 - PINCTRL_PIN(8, "gpio8"), 152 - PINCTRL_PIN(9, "gpio9"), 153 - PINCTRL_PIN(10, "gpio10"), 154 - PINCTRL_PIN(11, "gpio11"), 155 - PINCTRL_PIN(12, "gpio12"), 156 - PINCTRL_PIN(13, "gpio13"), 157 - PINCTRL_PIN(14, "gpio14"), 158 - PINCTRL_PIN(15, "gpio15"), 159 - PINCTRL_PIN(16, "gpio16"), 160 - PINCTRL_PIN(17, "gpio17"), 161 - PINCTRL_PIN(18, "gpio18"), 162 - PINCTRL_PIN(19, "gpio19"), 163 - PINCTRL_PIN(20, "gpio20"), 164 - PINCTRL_PIN(21, "gpio21"), 165 - PINCTRL_PIN(22, "gpio22"), 166 - PINCTRL_PIN(23, "gpio23"), 167 - PINCTRL_PIN(24, "gpio24"), 168 - PINCTRL_PIN(25, "gpio25"), 169 - PINCTRL_PIN(26, "gpio26"), 170 - PINCTRL_PIN(27, "gpio27"), 171 - PINCTRL_PIN(28, "gpio28"), 172 - PINCTRL_PIN(29, "gpio29"), 173 - PINCTRL_PIN(30, "gpio30"), 174 - PINCTRL_PIN(31, "gpio31"), 175 - PINCTRL_PIN(32, "gpio32"), 176 - PINCTRL_PIN(33, "gpio33"), 177 - PINCTRL_PIN(34, "gpio34"), 178 - PINCTRL_PIN(35, "gpio35"), 179 - PINCTRL_PIN(36, "gpio36"), 180 - PINCTRL_PIN(37, "gpio37"), 181 - PINCTRL_PIN(38, "gpio38"), 182 - PINCTRL_PIN(39, "gpio39"), 183 - PINCTRL_PIN(40, "gpio40"), 184 - PINCTRL_PIN(41, "gpio41"), 185 - PINCTRL_PIN(42, "gpio42"), 186 - PINCTRL_PIN(43, "gpio43"), 187 - PINCTRL_PIN(44, "gpio44"), 188 - PINCTRL_PIN(45, "gpio45"), 189 - PINCTRL_PIN(46, "gpio46"), 190 - PINCTRL_PIN(47, "gpio47"), 191 - PINCTRL_PIN(48, "gpio48"), 192 - PINCTRL_PIN(49, "gpio49"), 193 - }; 194 - 195 - static const char * const oxnas_ox810se_fct0_group[] = { 196 - "gpio0", "gpio1", "gpio2", "gpio3", 197 - "gpio4", "gpio5", "gpio6", "gpio7", 198 - "gpio8", "gpio9", "gpio10", "gpio11", 199 - "gpio12", "gpio13", "gpio14", "gpio15", 200 - "gpio16", "gpio17", "gpio18", "gpio19", 201 - "gpio20", "gpio21", "gpio22", "gpio23", 202 - "gpio24", "gpio25", "gpio26", "gpio27", 203 - "gpio28", "gpio29", "gpio30", "gpio31", 204 - "gpio32", "gpio33", "gpio34" 205 - }; 206 - 207 - static const char * const oxnas_ox810se_fct3_group[] = { 208 - "gpio0", "gpio1", "gpio2", "gpio3", 209 - "gpio4", "gpio5", "gpio6", "gpio7", 210 - "gpio8", "gpio9", 211 - "gpio20", 212 - "gpio22", "gpio23", "gpio24", "gpio25", 213 - "gpio26", "gpio27", "gpio28", "gpio29", 214 - "gpio30", "gpio31", "gpio32", "gpio33", 215 - "gpio34" 216 - }; 217 - 218 - static const char * const oxnas_ox820_fct0_group[] = { 219 - "gpio0", "gpio1", "gpio2", "gpio3", 220 - "gpio4", "gpio5", "gpio6", "gpio7", 221 - "gpio8", "gpio9", "gpio10", "gpio11", 222 - "gpio12", "gpio13", "gpio14", "gpio15", 223 - "gpio16", "gpio17", "gpio18", "gpio19", 224 - "gpio20", "gpio21", "gpio22", "gpio23", 225 - "gpio24", "gpio25", "gpio26", "gpio27", 226 - "gpio28", "gpio29", "gpio30", "gpio31", 227 - "gpio32", "gpio33", "gpio34", "gpio35", 228 - "gpio36", "gpio37", "gpio38", "gpio39", 229 - "gpio40", "gpio41", "gpio42", "gpio43", 230 - "gpio44", "gpio45", "gpio46", "gpio47", 231 - "gpio48", "gpio49" 232 - }; 233 - 234 - static const char * const oxnas_ox820_fct1_group[] = { 235 - "gpio3", "gpio4", 236 - "gpio12", "gpio13", "gpio14", "gpio15", 237 - "gpio16", "gpio17", "gpio18", "gpio19", 238 - "gpio20", "gpio21", "gpio22", "gpio23", 239 - "gpio24" 240 - }; 241 - 242 - static const char * const oxnas_ox820_fct4_group[] = { 243 - "gpio5", "gpio6", "gpio7", "gpio8", 244 - "gpio24", "gpio25", "gpio26", "gpio27", 245 - "gpio40", "gpio41", "gpio42", "gpio43" 246 - }; 247 - 248 - static const char * const oxnas_ox820_fct5_group[] = { 249 - "gpio28", "gpio29", "gpio30", "gpio31" 250 - }; 251 - 252 - #define FUNCTION(_name, _gr) \ 253 - { \ 254 - .name = #_name, \ 255 - .groups = oxnas_##_gr##_group, \ 256 - .ngroups = ARRAY_SIZE(oxnas_##_gr##_group), \ 257 - } 258 - 259 - static const struct oxnas_function oxnas_ox810se_functions[] = { 260 - FUNCTION(gpio, ox810se_fct0), 261 - FUNCTION(fct3, ox810se_fct3), 262 - }; 263 - 264 - static const struct oxnas_function oxnas_ox820_functions[] = { 265 - FUNCTION(gpio, ox820_fct0), 266 - FUNCTION(fct1, ox820_fct1), 267 - FUNCTION(fct4, ox820_fct4), 268 - FUNCTION(fct5, ox820_fct5), 269 - }; 270 - 271 - #define OXNAS_PINCTRL_GROUP(_pin, _name, ...) \ 272 - { \ 273 - .name = #_name, \ 274 - .pin = _pin, \ 275 - .bank = _pin / PINS_PER_BANK, \ 276 - .functions = (struct oxnas_desc_function[]){ \ 277 - __VA_ARGS__, { } }, \ 278 - } 279 - 280 - #define OXNAS_PINCTRL_FUNCTION(_name, _fct) \ 281 - { \ 282 - .name = #_name, \ 283 - .fct = _fct, \ 284 - } 285 - 286 - static const struct oxnas_pin_group oxnas_ox810se_groups[] = { 287 - OXNAS_PINCTRL_GROUP(0, gpio0, 288 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 289 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 290 - OXNAS_PINCTRL_GROUP(1, gpio1, 291 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 292 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 293 - OXNAS_PINCTRL_GROUP(2, gpio2, 294 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 295 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 296 - OXNAS_PINCTRL_GROUP(3, gpio3, 297 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 298 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 299 - OXNAS_PINCTRL_GROUP(4, gpio4, 300 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 301 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 302 - OXNAS_PINCTRL_GROUP(5, gpio5, 303 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 304 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 305 - OXNAS_PINCTRL_GROUP(6, gpio6, 306 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 307 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 308 - OXNAS_PINCTRL_GROUP(7, gpio7, 309 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 310 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 311 - OXNAS_PINCTRL_GROUP(8, gpio8, 312 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 313 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 314 - OXNAS_PINCTRL_GROUP(9, gpio9, 315 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 316 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 317 - OXNAS_PINCTRL_GROUP(10, gpio10, 318 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 319 - OXNAS_PINCTRL_GROUP(11, gpio11, 320 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 321 - OXNAS_PINCTRL_GROUP(12, gpio12, 322 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 323 - OXNAS_PINCTRL_GROUP(13, gpio13, 324 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 325 - OXNAS_PINCTRL_GROUP(14, gpio14, 326 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 327 - OXNAS_PINCTRL_GROUP(15, gpio15, 328 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 329 - OXNAS_PINCTRL_GROUP(16, gpio16, 330 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 331 - OXNAS_PINCTRL_GROUP(17, gpio17, 332 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 333 - OXNAS_PINCTRL_GROUP(18, gpio18, 334 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 335 - OXNAS_PINCTRL_GROUP(19, gpio19, 336 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 337 - OXNAS_PINCTRL_GROUP(20, gpio20, 338 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 339 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 340 - OXNAS_PINCTRL_GROUP(21, gpio21, 341 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 342 - OXNAS_PINCTRL_GROUP(22, gpio22, 343 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 344 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 345 - OXNAS_PINCTRL_GROUP(23, gpio23, 346 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 347 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 348 - OXNAS_PINCTRL_GROUP(24, gpio24, 349 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 350 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 351 - OXNAS_PINCTRL_GROUP(25, gpio25, 352 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 353 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 354 - OXNAS_PINCTRL_GROUP(26, gpio26, 355 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 356 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 357 - OXNAS_PINCTRL_GROUP(27, gpio27, 358 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 359 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 360 - OXNAS_PINCTRL_GROUP(28, gpio28, 361 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 362 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 363 - OXNAS_PINCTRL_GROUP(29, gpio29, 364 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 365 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 366 - OXNAS_PINCTRL_GROUP(30, gpio30, 367 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 368 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 369 - OXNAS_PINCTRL_GROUP(31, gpio31, 370 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 371 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 372 - OXNAS_PINCTRL_GROUP(32, gpio32, 373 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 374 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 375 - OXNAS_PINCTRL_GROUP(33, gpio33, 376 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 377 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 378 - OXNAS_PINCTRL_GROUP(34, gpio34, 379 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 380 - OXNAS_PINCTRL_FUNCTION(fct3, 3)), 381 - }; 382 - 383 - static const struct oxnas_pin_group oxnas_ox820_groups[] = { 384 - OXNAS_PINCTRL_GROUP(0, gpio0, 385 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 386 - OXNAS_PINCTRL_GROUP(1, gpio1, 387 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 388 - OXNAS_PINCTRL_GROUP(2, gpio2, 389 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 390 - OXNAS_PINCTRL_GROUP(3, gpio3, 391 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 392 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 393 - OXNAS_PINCTRL_GROUP(4, gpio4, 394 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 395 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 396 - OXNAS_PINCTRL_GROUP(5, gpio5, 397 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 398 - OXNAS_PINCTRL_FUNCTION(fct4, 4)), 399 - OXNAS_PINCTRL_GROUP(6, gpio6, 400 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 401 - OXNAS_PINCTRL_FUNCTION(fct4, 4)), 402 - OXNAS_PINCTRL_GROUP(7, gpio7, 403 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 404 - OXNAS_PINCTRL_FUNCTION(fct4, 4)), 405 - OXNAS_PINCTRL_GROUP(8, gpio8, 406 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 407 - OXNAS_PINCTRL_FUNCTION(fct4, 4)), 408 - OXNAS_PINCTRL_GROUP(9, gpio9, 409 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 410 - OXNAS_PINCTRL_GROUP(10, gpio10, 411 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 412 - OXNAS_PINCTRL_GROUP(11, gpio11, 413 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 414 - OXNAS_PINCTRL_GROUP(12, gpio12, 415 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 416 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 417 - OXNAS_PINCTRL_GROUP(13, gpio13, 418 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 419 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 420 - OXNAS_PINCTRL_GROUP(14, gpio14, 421 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 422 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 423 - OXNAS_PINCTRL_GROUP(15, gpio15, 424 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 425 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 426 - OXNAS_PINCTRL_GROUP(16, gpio16, 427 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 428 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 429 - OXNAS_PINCTRL_GROUP(17, gpio17, 430 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 431 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 432 - OXNAS_PINCTRL_GROUP(18, gpio18, 433 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 434 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 435 - OXNAS_PINCTRL_GROUP(19, gpio19, 436 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 437 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 438 - OXNAS_PINCTRL_GROUP(20, gpio20, 439 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 440 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 441 - OXNAS_PINCTRL_GROUP(21, gpio21, 442 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 443 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 444 - OXNAS_PINCTRL_GROUP(22, gpio22, 445 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 446 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 447 - OXNAS_PINCTRL_GROUP(23, gpio23, 448 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 449 - OXNAS_PINCTRL_FUNCTION(fct1, 1)), 450 - OXNAS_PINCTRL_GROUP(24, gpio24, 451 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 452 - OXNAS_PINCTRL_FUNCTION(fct1, 1), 453 - OXNAS_PINCTRL_FUNCTION(fct4, 5)), 454 - OXNAS_PINCTRL_GROUP(25, gpio25, 455 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 456 - OXNAS_PINCTRL_FUNCTION(fct4, 4)), 457 - OXNAS_PINCTRL_GROUP(26, gpio26, 458 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 459 - OXNAS_PINCTRL_FUNCTION(fct4, 4)), 460 - OXNAS_PINCTRL_GROUP(27, gpio27, 461 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 462 - OXNAS_PINCTRL_FUNCTION(fct4, 4)), 463 - OXNAS_PINCTRL_GROUP(28, gpio28, 464 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 465 - OXNAS_PINCTRL_FUNCTION(fct5, 5)), 466 - OXNAS_PINCTRL_GROUP(29, gpio29, 467 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 468 - OXNAS_PINCTRL_FUNCTION(fct5, 5)), 469 - OXNAS_PINCTRL_GROUP(30, gpio30, 470 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 471 - OXNAS_PINCTRL_FUNCTION(fct5, 5)), 472 - OXNAS_PINCTRL_GROUP(31, gpio31, 473 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 474 - OXNAS_PINCTRL_FUNCTION(fct5, 5)), 475 - OXNAS_PINCTRL_GROUP(32, gpio32, 476 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 477 - OXNAS_PINCTRL_GROUP(33, gpio33, 478 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 479 - OXNAS_PINCTRL_GROUP(34, gpio34, 480 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 481 - OXNAS_PINCTRL_GROUP(35, gpio35, 482 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 483 - OXNAS_PINCTRL_GROUP(36, gpio36, 484 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 485 - OXNAS_PINCTRL_GROUP(37, gpio37, 486 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 487 - OXNAS_PINCTRL_GROUP(38, gpio38, 488 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 489 - OXNAS_PINCTRL_GROUP(39, gpio39, 490 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 491 - OXNAS_PINCTRL_GROUP(40, gpio40, 492 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 493 - OXNAS_PINCTRL_FUNCTION(fct4, 4)), 494 - OXNAS_PINCTRL_GROUP(41, gpio41, 495 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 496 - OXNAS_PINCTRL_FUNCTION(fct4, 4)), 497 - OXNAS_PINCTRL_GROUP(42, gpio42, 498 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 499 - OXNAS_PINCTRL_FUNCTION(fct4, 4)), 500 - OXNAS_PINCTRL_GROUP(43, gpio43, 501 - OXNAS_PINCTRL_FUNCTION(gpio, 0), 502 - OXNAS_PINCTRL_FUNCTION(fct4, 4)), 503 - OXNAS_PINCTRL_GROUP(44, gpio44, 504 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 505 - OXNAS_PINCTRL_GROUP(45, gpio45, 506 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 507 - OXNAS_PINCTRL_GROUP(46, gpio46, 508 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 509 - OXNAS_PINCTRL_GROUP(47, gpio47, 510 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 511 - OXNAS_PINCTRL_GROUP(48, gpio48, 512 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 513 - OXNAS_PINCTRL_GROUP(49, gpio49, 514 - OXNAS_PINCTRL_FUNCTION(gpio, 0)), 515 - }; 516 - 517 - static inline struct oxnas_gpio_bank *pctl_to_bank(struct oxnas_pinctrl *pctl, 518 - unsigned int pin) 519 - { 520 - return &pctl->gpio_banks[pin / PINS_PER_BANK]; 521 - } 522 - 523 - static int oxnas_pinctrl_get_groups_count(struct pinctrl_dev *pctldev) 524 - { 525 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 526 - 527 - return pctl->ngroups; 528 - } 529 - 530 - static const char *oxnas_pinctrl_get_group_name(struct pinctrl_dev *pctldev, 531 - unsigned int group) 532 - { 533 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 534 - 535 - return pctl->groups[group].name; 536 - } 537 - 538 - static int oxnas_pinctrl_get_group_pins(struct pinctrl_dev *pctldev, 539 - unsigned int group, 540 - const unsigned int **pins, 541 - unsigned int *num_pins) 542 - { 543 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 544 - 545 - *pins = &pctl->groups[group].pin; 546 - *num_pins = 1; 547 - 548 - return 0; 549 - } 550 - 551 - static const struct pinctrl_ops oxnas_pinctrl_ops = { 552 - .get_groups_count = oxnas_pinctrl_get_groups_count, 553 - .get_group_name = oxnas_pinctrl_get_group_name, 554 - .get_group_pins = oxnas_pinctrl_get_group_pins, 555 - .dt_node_to_map = pinconf_generic_dt_node_to_map_pin, 556 - .dt_free_map = pinctrl_utils_free_map, 557 - }; 558 - 559 - static int oxnas_pinmux_get_functions_count(struct pinctrl_dev *pctldev) 560 - { 561 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 562 - 563 - return pctl->nfunctions; 564 - } 565 - 566 - static const char * 567 - oxnas_pinmux_get_function_name(struct pinctrl_dev *pctldev, unsigned int func) 568 - { 569 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 570 - 571 - return pctl->functions[func].name; 572 - } 573 - 574 - static int oxnas_pinmux_get_function_groups(struct pinctrl_dev *pctldev, 575 - unsigned int func, 576 - const char * const **groups, 577 - unsigned int * const num_groups) 578 - { 579 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 580 - 581 - *groups = pctl->functions[func].groups; 582 - *num_groups = pctl->functions[func].ngroups; 583 - 584 - return 0; 585 - } 586 - 587 - static int oxnas_ox810se_pinmux_enable(struct pinctrl_dev *pctldev, 588 - unsigned int func, unsigned int group) 589 - { 590 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 591 - const struct oxnas_pin_group *pg = &pctl->groups[group]; 592 - const struct oxnas_function *pf = &pctl->functions[func]; 593 - const char *fname = pf->name; 594 - struct oxnas_desc_function *functions = pg->functions; 595 - u32 mask = BIT(pg->pin); 596 - 597 - while (functions->name) { 598 - if (!strcmp(functions->name, fname)) { 599 - dev_dbg(pctl->dev, 600 - "setting function %s bank %d pin %d fct %d mask %x\n", 601 - fname, pg->bank, pg->pin, 602 - functions->fct, mask); 603 - 604 - regmap_write_bits(pctl->regmap, 605 - (pg->bank ? 606 - PINMUX_810_PRIMARY_SEL1 : 607 - PINMUX_810_PRIMARY_SEL0), 608 - mask, 609 - (functions->fct == 1 ? 610 - mask : 0)); 611 - regmap_write_bits(pctl->regmap, 612 - (pg->bank ? 613 - PINMUX_810_SECONDARY_SEL1 : 614 - PINMUX_810_SECONDARY_SEL0), 615 - mask, 616 - (functions->fct == 2 ? 617 - mask : 0)); 618 - regmap_write_bits(pctl->regmap, 619 - (pg->bank ? 620 - PINMUX_810_TERTIARY_SEL1 : 621 - PINMUX_810_TERTIARY_SEL0), 622 - mask, 623 - (functions->fct == 3 ? 624 - mask : 0)); 625 - 626 - return 0; 627 - } 628 - 629 - functions++; 630 - } 631 - 632 - dev_err(pctl->dev, "cannot mux pin %u to function %u\n", group, func); 633 - 634 - return -EINVAL; 635 - } 636 - 637 - static int oxnas_ox820_pinmux_enable(struct pinctrl_dev *pctldev, 638 - unsigned int func, unsigned int group) 639 - { 640 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 641 - const struct oxnas_pin_group *pg = &pctl->groups[group]; 642 - const struct oxnas_function *pf = &pctl->functions[func]; 643 - const char *fname = pf->name; 644 - struct oxnas_desc_function *functions = pg->functions; 645 - unsigned int offset = (pg->bank ? PINMUX_820_BANK_OFFSET : 0); 646 - u32 mask = BIT(pg->pin); 647 - 648 - while (functions->name) { 649 - if (!strcmp(functions->name, fname)) { 650 - dev_dbg(pctl->dev, 651 - "setting function %s bank %d pin %d fct %d mask %x\n", 652 - fname, pg->bank, pg->pin, 653 - functions->fct, mask); 654 - 655 - regmap_write_bits(pctl->regmap, 656 - offset + PINMUX_820_SECONDARY_SEL, 657 - mask, 658 - (functions->fct == 1 ? 659 - mask : 0)); 660 - regmap_write_bits(pctl->regmap, 661 - offset + PINMUX_820_TERTIARY_SEL, 662 - mask, 663 - (functions->fct == 2 ? 664 - mask : 0)); 665 - regmap_write_bits(pctl->regmap, 666 - offset + PINMUX_820_QUATERNARY_SEL, 667 - mask, 668 - (functions->fct == 3 ? 669 - mask : 0)); 670 - regmap_write_bits(pctl->regmap, 671 - offset + PINMUX_820_DEBUG_SEL, 672 - mask, 673 - (functions->fct == 4 ? 674 - mask : 0)); 675 - regmap_write_bits(pctl->regmap, 676 - offset + PINMUX_820_ALTERNATIVE_SEL, 677 - mask, 678 - (functions->fct == 5 ? 679 - mask : 0)); 680 - 681 - return 0; 682 - } 683 - 684 - functions++; 685 - } 686 - 687 - dev_err(pctl->dev, "cannot mux pin %u to function %u\n", group, func); 688 - 689 - return -EINVAL; 690 - } 691 - 692 - static int oxnas_ox810se_gpio_request_enable(struct pinctrl_dev *pctldev, 693 - struct pinctrl_gpio_range *range, 694 - unsigned int offset) 695 - { 696 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 697 - struct oxnas_gpio_bank *bank = gpiochip_get_data(range->gc); 698 - u32 mask = BIT(offset - bank->gpio_chip.base); 699 - 700 - dev_dbg(pctl->dev, "requesting gpio %d in bank %d (id %d) with mask 0x%x\n", 701 - offset, bank->gpio_chip.base, bank->id, mask); 702 - 703 - regmap_write_bits(pctl->regmap, 704 - (bank->id ? 705 - PINMUX_810_PRIMARY_SEL1 : 706 - PINMUX_810_PRIMARY_SEL0), 707 - mask, 0); 708 - regmap_write_bits(pctl->regmap, 709 - (bank->id ? 710 - PINMUX_810_SECONDARY_SEL1 : 711 - PINMUX_810_SECONDARY_SEL0), 712 - mask, 0); 713 - regmap_write_bits(pctl->regmap, 714 - (bank->id ? 715 - PINMUX_810_TERTIARY_SEL1 : 716 - PINMUX_810_TERTIARY_SEL0), 717 - mask, 0); 718 - 719 - return 0; 720 - } 721 - 722 - static int oxnas_ox820_gpio_request_enable(struct pinctrl_dev *pctldev, 723 - struct pinctrl_gpio_range *range, 724 - unsigned int offset) 725 - { 726 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 727 - struct oxnas_gpio_bank *bank = gpiochip_get_data(range->gc); 728 - unsigned int bank_offset = (bank->id ? PINMUX_820_BANK_OFFSET : 0); 729 - u32 mask = BIT(offset - bank->gpio_chip.base); 730 - 731 - dev_dbg(pctl->dev, "requesting gpio %d in bank %d (id %d) with mask 0x%x\n", 732 - offset, bank->gpio_chip.base, bank->id, mask); 733 - 734 - regmap_write_bits(pctl->regmap, 735 - bank_offset + PINMUX_820_SECONDARY_SEL, 736 - mask, 0); 737 - regmap_write_bits(pctl->regmap, 738 - bank_offset + PINMUX_820_TERTIARY_SEL, 739 - mask, 0); 740 - regmap_write_bits(pctl->regmap, 741 - bank_offset + PINMUX_820_QUATERNARY_SEL, 742 - mask, 0); 743 - regmap_write_bits(pctl->regmap, 744 - bank_offset + PINMUX_820_DEBUG_SEL, 745 - mask, 0); 746 - regmap_write_bits(pctl->regmap, 747 - bank_offset + PINMUX_820_ALTERNATIVE_SEL, 748 - mask, 0); 749 - 750 - return 0; 751 - } 752 - 753 - static int oxnas_gpio_get_direction(struct gpio_chip *chip, 754 - unsigned int offset) 755 - { 756 - struct oxnas_gpio_bank *bank = gpiochip_get_data(chip); 757 - u32 mask = BIT(offset); 758 - 759 - if (readl_relaxed(bank->reg_base + OUTPUT_EN) & mask) 760 - return GPIO_LINE_DIRECTION_OUT; 761 - 762 - return GPIO_LINE_DIRECTION_IN; 763 - } 764 - 765 - static int oxnas_gpio_direction_input(struct gpio_chip *chip, 766 - unsigned int offset) 767 - { 768 - struct oxnas_gpio_bank *bank = gpiochip_get_data(chip); 769 - u32 mask = BIT(offset); 770 - 771 - writel_relaxed(mask, bank->reg_base + OUTPUT_EN_CLEAR); 772 - 773 - return 0; 774 - } 775 - 776 - static int oxnas_gpio_get(struct gpio_chip *chip, unsigned int offset) 777 - { 778 - struct oxnas_gpio_bank *bank = gpiochip_get_data(chip); 779 - u32 mask = BIT(offset); 780 - 781 - return (readl_relaxed(bank->reg_base + INPUT_VALUE) & mask) != 0; 782 - } 783 - 784 - static void oxnas_gpio_set(struct gpio_chip *chip, unsigned int offset, 785 - int value) 786 - { 787 - struct oxnas_gpio_bank *bank = gpiochip_get_data(chip); 788 - u32 mask = BIT(offset); 789 - 790 - if (value) 791 - writel_relaxed(mask, bank->reg_base + OUTPUT_SET); 792 - else 793 - writel_relaxed(mask, bank->reg_base + OUTPUT_CLEAR); 794 - } 795 - 796 - static int oxnas_gpio_direction_output(struct gpio_chip *chip, 797 - unsigned int offset, int value) 798 - { 799 - struct oxnas_gpio_bank *bank = gpiochip_get_data(chip); 800 - u32 mask = BIT(offset); 801 - 802 - oxnas_gpio_set(chip, offset, value); 803 - writel_relaxed(mask, bank->reg_base + OUTPUT_EN_SET); 804 - 805 - return 0; 806 - } 807 - 808 - static int oxnas_gpio_set_direction(struct pinctrl_dev *pctldev, 809 - struct pinctrl_gpio_range *range, 810 - unsigned int offset, bool input) 811 - { 812 - struct gpio_chip *chip = range->gc; 813 - 814 - if (input) 815 - oxnas_gpio_direction_input(chip, offset); 816 - else 817 - oxnas_gpio_direction_output(chip, offset, 0); 818 - 819 - return 0; 820 - } 821 - 822 - static const struct pinmux_ops oxnas_ox810se_pinmux_ops = { 823 - .get_functions_count = oxnas_pinmux_get_functions_count, 824 - .get_function_name = oxnas_pinmux_get_function_name, 825 - .get_function_groups = oxnas_pinmux_get_function_groups, 826 - .set_mux = oxnas_ox810se_pinmux_enable, 827 - .gpio_request_enable = oxnas_ox810se_gpio_request_enable, 828 - .gpio_set_direction = oxnas_gpio_set_direction, 829 - }; 830 - 831 - static const struct pinmux_ops oxnas_ox820_pinmux_ops = { 832 - .get_functions_count = oxnas_pinmux_get_functions_count, 833 - .get_function_name = oxnas_pinmux_get_function_name, 834 - .get_function_groups = oxnas_pinmux_get_function_groups, 835 - .set_mux = oxnas_ox820_pinmux_enable, 836 - .gpio_request_enable = oxnas_ox820_gpio_request_enable, 837 - .gpio_set_direction = oxnas_gpio_set_direction, 838 - }; 839 - 840 - static int oxnas_ox810se_pinconf_get(struct pinctrl_dev *pctldev, 841 - unsigned int pin, unsigned long *config) 842 - { 843 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 844 - struct oxnas_gpio_bank *bank = pctl_to_bank(pctl, pin); 845 - unsigned int param = pinconf_to_config_param(*config); 846 - u32 mask = BIT(pin - bank->gpio_chip.base); 847 - int ret; 848 - u32 arg; 849 - 850 - switch (param) { 851 - case PIN_CONFIG_BIAS_PULL_UP: 852 - ret = regmap_read(pctl->regmap, 853 - (bank->id ? 854 - PINMUX_810_PULLUP_CTRL1 : 855 - PINMUX_810_PULLUP_CTRL0), 856 - &arg); 857 - if (ret) 858 - return ret; 859 - 860 - arg = !!(arg & mask); 861 - break; 862 - default: 863 - return -ENOTSUPP; 864 - } 865 - 866 - *config = pinconf_to_config_packed(param, arg); 867 - 868 - return 0; 869 - } 870 - 871 - static int oxnas_ox820_pinconf_get(struct pinctrl_dev *pctldev, 872 - unsigned int pin, unsigned long *config) 873 - { 874 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 875 - struct oxnas_gpio_bank *bank = pctl_to_bank(pctl, pin); 876 - unsigned int param = pinconf_to_config_param(*config); 877 - unsigned int bank_offset = (bank->id ? PINMUX_820_BANK_OFFSET : 0); 878 - u32 mask = BIT(pin - bank->gpio_chip.base); 879 - int ret; 880 - u32 arg; 881 - 882 - switch (param) { 883 - case PIN_CONFIG_BIAS_PULL_UP: 884 - ret = regmap_read(pctl->regmap, 885 - bank_offset + PINMUX_820_PULLUP_CTRL, 886 - &arg); 887 - if (ret) 888 - return ret; 889 - 890 - arg = !!(arg & mask); 891 - break; 892 - default: 893 - return -ENOTSUPP; 894 - } 895 - 896 - *config = pinconf_to_config_packed(param, arg); 897 - 898 - return 0; 899 - } 900 - 901 - static int oxnas_ox810se_pinconf_set(struct pinctrl_dev *pctldev, 902 - unsigned int pin, unsigned long *configs, 903 - unsigned int num_configs) 904 - { 905 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 906 - struct oxnas_gpio_bank *bank = pctl_to_bank(pctl, pin); 907 - unsigned int param; 908 - unsigned int i; 909 - u32 offset = pin - bank->gpio_chip.base; 910 - u32 mask = BIT(offset); 911 - 912 - dev_dbg(pctl->dev, "setting pin %d bank %d mask 0x%x\n", 913 - pin, bank->gpio_chip.base, mask); 914 - 915 - for (i = 0; i < num_configs; i++) { 916 - param = pinconf_to_config_param(configs[i]); 917 - 918 - switch (param) { 919 - case PIN_CONFIG_BIAS_PULL_UP: 920 - dev_dbg(pctl->dev, " pullup\n"); 921 - regmap_write_bits(pctl->regmap, 922 - (bank->id ? 923 - PINMUX_810_PULLUP_CTRL1 : 924 - PINMUX_810_PULLUP_CTRL0), 925 - mask, mask); 926 - break; 927 - default: 928 - dev_err(pctl->dev, "Property %u not supported\n", 929 - param); 930 - return -ENOTSUPP; 931 - } 932 - } 933 - 934 - return 0; 935 - } 936 - 937 - static int oxnas_ox820_pinconf_set(struct pinctrl_dev *pctldev, 938 - unsigned int pin, unsigned long *configs, 939 - unsigned int num_configs) 940 - { 941 - struct oxnas_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 942 - struct oxnas_gpio_bank *bank = pctl_to_bank(pctl, pin); 943 - unsigned int bank_offset = (bank->id ? PINMUX_820_BANK_OFFSET : 0); 944 - unsigned int param; 945 - unsigned int i; 946 - u32 offset = pin - bank->gpio_chip.base; 947 - u32 mask = BIT(offset); 948 - 949 - dev_dbg(pctl->dev, "setting pin %d bank %d mask 0x%x\n", 950 - pin, bank->gpio_chip.base, mask); 951 - 952 - for (i = 0; i < num_configs; i++) { 953 - param = pinconf_to_config_param(configs[i]); 954 - 955 - switch (param) { 956 - case PIN_CONFIG_BIAS_PULL_UP: 957 - dev_dbg(pctl->dev, " pullup\n"); 958 - regmap_write_bits(pctl->regmap, 959 - bank_offset + PINMUX_820_PULLUP_CTRL, 960 - mask, mask); 961 - break; 962 - default: 963 - dev_err(pctl->dev, "Property %u not supported\n", 964 - param); 965 - return -ENOTSUPP; 966 - } 967 - } 968 - 969 - return 0; 970 - } 971 - 972 - static const struct pinconf_ops oxnas_ox810se_pinconf_ops = { 973 - .pin_config_get = oxnas_ox810se_pinconf_get, 974 - .pin_config_set = oxnas_ox810se_pinconf_set, 975 - .is_generic = true, 976 - }; 977 - 978 - static const struct pinconf_ops oxnas_ox820_pinconf_ops = { 979 - .pin_config_get = oxnas_ox820_pinconf_get, 980 - .pin_config_set = oxnas_ox820_pinconf_set, 981 - .is_generic = true, 982 - }; 983 - 984 - static void oxnas_gpio_irq_ack(struct irq_data *data) 985 - { 986 - struct gpio_chip *chip = irq_data_get_irq_chip_data(data); 987 - struct oxnas_gpio_bank *bank = gpiochip_get_data(chip); 988 - u32 mask = BIT(data->hwirq); 989 - 990 - writel(mask, bank->reg_base + IRQ_PENDING); 991 - } 992 - 993 - static void oxnas_gpio_irq_mask(struct irq_data *data) 994 - { 995 - struct gpio_chip *chip = irq_data_get_irq_chip_data(data); 996 - struct oxnas_gpio_bank *bank = gpiochip_get_data(chip); 997 - unsigned int type = irqd_get_trigger_type(data); 998 - u32 mask = BIT(data->hwirq); 999 - 1000 - if (type & IRQ_TYPE_EDGE_RISING) 1001 - writel(readl(bank->reg_base + RE_IRQ_ENABLE) & ~mask, 1002 - bank->reg_base + RE_IRQ_ENABLE); 1003 - 1004 - if (type & IRQ_TYPE_EDGE_FALLING) 1005 - writel(readl(bank->reg_base + FE_IRQ_ENABLE) & ~mask, 1006 - bank->reg_base + FE_IRQ_ENABLE); 1007 - } 1008 - 1009 - static void oxnas_gpio_irq_unmask(struct irq_data *data) 1010 - { 1011 - struct gpio_chip *chip = irq_data_get_irq_chip_data(data); 1012 - struct oxnas_gpio_bank *bank = gpiochip_get_data(chip); 1013 - unsigned int type = irqd_get_trigger_type(data); 1014 - u32 mask = BIT(data->hwirq); 1015 - 1016 - if (type & IRQ_TYPE_EDGE_RISING) 1017 - writel(readl(bank->reg_base + RE_IRQ_ENABLE) | mask, 1018 - bank->reg_base + RE_IRQ_ENABLE); 1019 - 1020 - if (type & IRQ_TYPE_EDGE_FALLING) 1021 - writel(readl(bank->reg_base + FE_IRQ_ENABLE) | mask, 1022 - bank->reg_base + FE_IRQ_ENABLE); 1023 - } 1024 - 1025 - static unsigned int oxnas_gpio_irq_startup(struct irq_data *data) 1026 - { 1027 - struct gpio_chip *chip = irq_data_get_irq_chip_data(data); 1028 - 1029 - oxnas_gpio_direction_input(chip, data->hwirq); 1030 - oxnas_gpio_irq_unmask(data); 1031 - 1032 - return 0; 1033 - } 1034 - 1035 - static int oxnas_gpio_irq_set_type(struct irq_data *data, unsigned int type) 1036 - { 1037 - if ((type & (IRQ_TYPE_EDGE_RISING|IRQ_TYPE_EDGE_FALLING)) == 0) 1038 - return -EINVAL; 1039 - 1040 - irq_set_handler_locked(data, handle_edge_irq); 1041 - 1042 - return 0; 1043 - } 1044 - 1045 - static void oxnas_gpio_irq_handler(struct irq_desc *desc) 1046 - { 1047 - struct gpio_chip *gc = irq_desc_get_handler_data(desc); 1048 - struct oxnas_gpio_bank *bank = gpiochip_get_data(gc); 1049 - struct irq_chip *chip = irq_desc_get_chip(desc); 1050 - unsigned long stat; 1051 - unsigned int pin; 1052 - 1053 - chained_irq_enter(chip, desc); 1054 - 1055 - stat = readl(bank->reg_base + IRQ_PENDING); 1056 - 1057 - for_each_set_bit(pin, &stat, BITS_PER_LONG) 1058 - generic_handle_domain_irq(gc->irq.domain, pin); 1059 - 1060 - chained_irq_exit(chip, desc); 1061 - } 1062 - 1063 - #define GPIO_BANK(_bank) \ 1064 - { \ 1065 - .gpio_chip = { \ 1066 - .label = "GPIO" #_bank, \ 1067 - .request = gpiochip_generic_request, \ 1068 - .free = gpiochip_generic_free, \ 1069 - .get_direction = oxnas_gpio_get_direction, \ 1070 - .direction_input = oxnas_gpio_direction_input, \ 1071 - .direction_output = oxnas_gpio_direction_output, \ 1072 - .get = oxnas_gpio_get, \ 1073 - .set = oxnas_gpio_set, \ 1074 - .ngpio = PINS_PER_BANK, \ 1075 - .base = GPIO_BANK_START(_bank), \ 1076 - .owner = THIS_MODULE, \ 1077 - .can_sleep = 0, \ 1078 - }, \ 1079 - .irq_chip = { \ 1080 - .name = "GPIO" #_bank, \ 1081 - .irq_startup = oxnas_gpio_irq_startup, \ 1082 - .irq_ack = oxnas_gpio_irq_ack, \ 1083 - .irq_mask = oxnas_gpio_irq_mask, \ 1084 - .irq_unmask = oxnas_gpio_irq_unmask, \ 1085 - .irq_set_type = oxnas_gpio_irq_set_type, \ 1086 - }, \ 1087 - } 1088 - 1089 - static struct oxnas_gpio_bank oxnas_gpio_banks[] = { 1090 - GPIO_BANK(0), 1091 - GPIO_BANK(1), 1092 - }; 1093 - 1094 - static struct oxnas_pinctrl ox810se_pinctrl = { 1095 - .functions = oxnas_ox810se_functions, 1096 - .nfunctions = ARRAY_SIZE(oxnas_ox810se_functions), 1097 - .groups = oxnas_ox810se_groups, 1098 - .ngroups = ARRAY_SIZE(oxnas_ox810se_groups), 1099 - .gpio_banks = oxnas_gpio_banks, 1100 - .nbanks = ARRAY_SIZE(oxnas_gpio_banks), 1101 - }; 1102 - 1103 - static struct pinctrl_desc oxnas_ox810se_pinctrl_desc = { 1104 - .name = "oxnas-pinctrl", 1105 - .pins = oxnas_ox810se_pins, 1106 - .npins = ARRAY_SIZE(oxnas_ox810se_pins), 1107 - .pctlops = &oxnas_pinctrl_ops, 1108 - .pmxops = &oxnas_ox810se_pinmux_ops, 1109 - .confops = &oxnas_ox810se_pinconf_ops, 1110 - .owner = THIS_MODULE, 1111 - }; 1112 - 1113 - static struct oxnas_pinctrl ox820_pinctrl = { 1114 - .functions = oxnas_ox820_functions, 1115 - .nfunctions = ARRAY_SIZE(oxnas_ox820_functions), 1116 - .groups = oxnas_ox820_groups, 1117 - .ngroups = ARRAY_SIZE(oxnas_ox820_groups), 1118 - .gpio_banks = oxnas_gpio_banks, 1119 - .nbanks = ARRAY_SIZE(oxnas_gpio_banks), 1120 - }; 1121 - 1122 - static struct pinctrl_desc oxnas_ox820_pinctrl_desc = { 1123 - .name = "oxnas-pinctrl", 1124 - .pins = oxnas_ox820_pins, 1125 - .npins = ARRAY_SIZE(oxnas_ox820_pins), 1126 - .pctlops = &oxnas_pinctrl_ops, 1127 - .pmxops = &oxnas_ox820_pinmux_ops, 1128 - .confops = &oxnas_ox820_pinconf_ops, 1129 - .owner = THIS_MODULE, 1130 - }; 1131 - 1132 - static struct oxnas_pinctrl_data oxnas_ox810se_pinctrl_data = { 1133 - .desc = &oxnas_ox810se_pinctrl_desc, 1134 - .pctl = &ox810se_pinctrl, 1135 - }; 1136 - 1137 - static struct oxnas_pinctrl_data oxnas_ox820_pinctrl_data = { 1138 - .desc = &oxnas_ox820_pinctrl_desc, 1139 - .pctl = &ox820_pinctrl, 1140 - }; 1141 - 1142 - static const struct of_device_id oxnas_pinctrl_of_match[] = { 1143 - { .compatible = "oxsemi,ox810se-pinctrl", 1144 - .data = &oxnas_ox810se_pinctrl_data 1145 - }, 1146 - { .compatible = "oxsemi,ox820-pinctrl", 1147 - .data = &oxnas_ox820_pinctrl_data, 1148 - }, 1149 - { }, 1150 - }; 1151 - 1152 - static int oxnas_pinctrl_probe(struct platform_device *pdev) 1153 - { 1154 - const struct of_device_id *id; 1155 - const struct oxnas_pinctrl_data *data; 1156 - struct oxnas_pinctrl *pctl; 1157 - 1158 - id = of_match_node(oxnas_pinctrl_of_match, pdev->dev.of_node); 1159 - if (!id) 1160 - return -ENODEV; 1161 - 1162 - data = id->data; 1163 - if (!data || !data->pctl || !data->desc) 1164 - return -EINVAL; 1165 - 1166 - pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL); 1167 - if (!pctl) 1168 - return -ENOMEM; 1169 - pctl->dev = &pdev->dev; 1170 - dev_set_drvdata(&pdev->dev, pctl); 1171 - 1172 - pctl->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, 1173 - "oxsemi,sys-ctrl"); 1174 - if (IS_ERR(pctl->regmap)) { 1175 - dev_err(&pdev->dev, "failed to get sys ctrl regmap\n"); 1176 - return -ENODEV; 1177 - } 1178 - 1179 - pctl->functions = data->pctl->functions; 1180 - pctl->nfunctions = data->pctl->nfunctions; 1181 - pctl->groups = data->pctl->groups; 1182 - pctl->ngroups = data->pctl->ngroups; 1183 - pctl->gpio_banks = data->pctl->gpio_banks; 1184 - pctl->nbanks = data->pctl->nbanks; 1185 - 1186 - pctl->pctldev = pinctrl_register(data->desc, &pdev->dev, pctl); 1187 - if (IS_ERR(pctl->pctldev)) { 1188 - dev_err(&pdev->dev, "Failed to register pinctrl device\n"); 1189 - return PTR_ERR(pctl->pctldev); 1190 - } 1191 - 1192 - return 0; 1193 - } 1194 - 1195 - static int oxnas_gpio_probe(struct platform_device *pdev) 1196 - { 1197 - struct device_node *np = pdev->dev.of_node; 1198 - struct of_phandle_args pinspec; 1199 - struct oxnas_gpio_bank *bank; 1200 - unsigned int id, ngpios; 1201 - int irq, ret; 1202 - struct gpio_irq_chip *girq; 1203 - 1204 - if (of_parse_phandle_with_fixed_args(np, "gpio-ranges", 1205 - 3, 0, &pinspec)) { 1206 - dev_err(&pdev->dev, "gpio-ranges property not found\n"); 1207 - return -EINVAL; 1208 - } 1209 - 1210 - id = pinspec.args[1] / PINS_PER_BANK; 1211 - ngpios = pinspec.args[2]; 1212 - 1213 - if (id >= ARRAY_SIZE(oxnas_gpio_banks)) { 1214 - dev_err(&pdev->dev, "invalid gpio-ranges base arg\n"); 1215 - return -EINVAL; 1216 - } 1217 - 1218 - if (ngpios > PINS_PER_BANK) { 1219 - dev_err(&pdev->dev, "invalid gpio-ranges count arg\n"); 1220 - return -EINVAL; 1221 - } 1222 - 1223 - bank = &oxnas_gpio_banks[id]; 1224 - 1225 - bank->reg_base = devm_platform_ioremap_resource(pdev, 0); 1226 - if (IS_ERR(bank->reg_base)) 1227 - return PTR_ERR(bank->reg_base); 1228 - 1229 - irq = platform_get_irq(pdev, 0); 1230 - if (irq < 0) 1231 - return irq; 1232 - 1233 - bank->id = id; 1234 - bank->gpio_chip.parent = &pdev->dev; 1235 - bank->gpio_chip.ngpio = ngpios; 1236 - girq = &bank->gpio_chip.irq; 1237 - girq->chip = &bank->irq_chip; 1238 - girq->parent_handler = oxnas_gpio_irq_handler; 1239 - girq->num_parents = 1; 1240 - girq->parents = devm_kcalloc(&pdev->dev, 1, sizeof(*girq->parents), 1241 - GFP_KERNEL); 1242 - if (!girq->parents) 1243 - return -ENOMEM; 1244 - girq->parents[0] = irq; 1245 - girq->default_type = IRQ_TYPE_NONE; 1246 - girq->handler = handle_level_irq; 1247 - 1248 - ret = gpiochip_add_data(&bank->gpio_chip, bank); 1249 - if (ret < 0) { 1250 - dev_err(&pdev->dev, "Failed to add GPIO chip %u: %d\n", 1251 - id, ret); 1252 - return ret; 1253 - } 1254 - 1255 - return 0; 1256 - } 1257 - 1258 - static struct platform_driver oxnas_pinctrl_driver = { 1259 - .driver = { 1260 - .name = "oxnas-pinctrl", 1261 - .of_match_table = oxnas_pinctrl_of_match, 1262 - .suppress_bind_attrs = true, 1263 - }, 1264 - .probe = oxnas_pinctrl_probe, 1265 - }; 1266 - 1267 - static const struct of_device_id oxnas_gpio_of_match[] = { 1268 - { .compatible = "oxsemi,ox810se-gpio", }, 1269 - { .compatible = "oxsemi,ox820-gpio", }, 1270 - { }, 1271 - }; 1272 - 1273 - static struct platform_driver oxnas_gpio_driver = { 1274 - .driver = { 1275 - .name = "oxnas-gpio", 1276 - .of_match_table = oxnas_gpio_of_match, 1277 - .suppress_bind_attrs = true, 1278 - }, 1279 - .probe = oxnas_gpio_probe, 1280 - }; 1281 - 1282 - static int __init oxnas_gpio_register(void) 1283 - { 1284 - return platform_driver_register(&oxnas_gpio_driver); 1285 - } 1286 - arch_initcall(oxnas_gpio_register); 1287 - 1288 - static int __init oxnas_pinctrl_register(void) 1289 - { 1290 - return platform_driver_register(&oxnas_pinctrl_driver); 1291 - } 1292 - arch_initcall(oxnas_pinctrl_register);
-1
drivers/pinctrl/pinctrl-palmas.c
··· 11 11 #include <linux/module.h> 12 12 #include <linux/mfd/palmas.h> 13 13 #include <linux/of.h> 14 - #include <linux/of_device.h> 15 14 #include <linux/platform_device.h> 16 15 #include <linux/pinctrl/machine.h> 17 16 #include <linux/pinctrl/pinctrl.h>
+1 -4
drivers/pinctrl/pinctrl-pic32.c
··· 11 11 #include <linux/io.h> 12 12 #include <linux/irq.h> 13 13 #include <linux/of.h> 14 - #include <linux/of_device.h> 15 14 #include <linux/pinctrl/pinconf.h> 16 15 #include <linux/pinctrl/pinconf-generic.h> 17 16 #include <linux/pinctrl/pinctrl.h> ··· 2161 2162 static int pic32_pinctrl_probe(struct platform_device *pdev) 2162 2163 { 2163 2164 struct pic32_pinctrl *pctl; 2164 - struct resource *res; 2165 2165 int ret; 2166 2166 2167 2167 pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL); ··· 2169 2171 pctl->dev = &pdev->dev; 2170 2172 dev_set_drvdata(&pdev->dev, pctl); 2171 2173 2172 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2173 - pctl->reg_base = devm_ioremap_resource(&pdev->dev, res); 2174 + pctl->reg_base = devm_platform_ioremap_resource(pdev, 0); 2174 2175 if (IS_ERR(pctl->reg_base)) 2175 2176 return PTR_ERR(pctl->reg_base); 2176 2177
+2 -3
drivers/pinctrl/pinctrl-rockchip.c
··· 21 21 #include <linux/io.h> 22 22 #include <linux/bitops.h> 23 23 #include <linux/gpio/driver.h> 24 - #include <linux/of_address.h> 25 - #include <linux/of_device.h> 26 - #include <linux/of_irq.h> 24 + #include <linux/of.h> 25 + #include <linux/of_platform.h> 27 26 #include <linux/pinctrl/machine.h> 28 27 #include <linux/pinctrl/pinconf.h> 29 28 #include <linux/pinctrl/pinctrl.h>
+10 -4
drivers/pinctrl/pinctrl-single.c
··· 12 12 #include <linux/init.h> 13 13 #include <linux/module.h> 14 14 #include <linux/io.h> 15 + #include <linux/platform_device.h> 15 16 #include <linux/slab.h> 16 17 #include <linux/err.h> 17 18 #include <linux/list.h> 18 19 #include <linux/interrupt.h> 19 20 #include <linux/irqchip/chained_irq.h> 20 21 #include <linux/of.h> 21 - #include <linux/of_device.h> 22 - #include <linux/of_address.h> 23 22 #include <linux/of_irq.h> 24 23 #include <linux/seq_file.h> 25 24 ··· 1954 1955 .irq_status_mask = (1 << 30), /* OMAP_WAKEUP_EVENT */ 1955 1956 }; 1956 1957 1958 + static const struct pcs_soc_data pinctrl_single_am654 = { 1959 + .flags = PCS_QUIRK_SHARED_IRQ | PCS_CONTEXT_LOSS_OFF, 1960 + .irq_enable_mask = (1 << 29), /* WKUP_EN */ 1961 + .irq_status_mask = (1 << 30), /* WKUP_EVT */ 1962 + }; 1963 + 1957 1964 static const struct pcs_soc_data pinctrl_single = { 1958 1965 }; 1959 1966 ··· 1968 1963 }; 1969 1964 1970 1965 static const struct of_device_id pcs_of_match[] = { 1966 + { .compatible = "ti,am437-padconf", .data = &pinctrl_single_am437x }, 1967 + { .compatible = "ti,am654-padconf", .data = &pinctrl_single_am654 }, 1968 + { .compatible = "ti,dra7-padconf", .data = &pinctrl_single_dra7 }, 1971 1969 { .compatible = "ti,omap3-padconf", .data = &pinctrl_single_omap_wkup }, 1972 1970 { .compatible = "ti,omap4-padconf", .data = &pinctrl_single_omap_wkup }, 1973 1971 { .compatible = "ti,omap5-padconf", .data = &pinctrl_single_omap_wkup }, 1974 - { .compatible = "ti,dra7-padconf", .data = &pinctrl_single_dra7 }, 1975 - { .compatible = "ti,am437-padconf", .data = &pinctrl_single_am437x }, 1976 1972 { .compatible = "pinctrl-single", .data = &pinctrl_single }, 1977 1973 { .compatible = "pinconf-single", .data = &pinconf_single }, 1978 1974 { },
+2 -2
drivers/pinctrl/pinctrl-stmfx.c
··· 659 659 } 660 660 661 661 irq = platform_get_irq(pdev, 0); 662 - if (irq <= 0) 663 - return -ENXIO; 662 + if (irq < 0) 663 + return irq; 664 664 665 665 mutex_init(&pctl->lock); 666 666
-1
drivers/pinctrl/pinctrl-sx150x.c
··· 19 19 #include <linux/mutex.h> 20 20 #include <linux/slab.h> 21 21 #include <linux/of.h> 22 - #include <linux/of_device.h> 23 22 #include <linux/gpio/driver.h> 24 23 #include <linux/pinctrl/pinconf.h> 25 24 #include <linux/pinctrl/pinctrl.h>
+9
drivers/pinctrl/pinctrl-zynqmp.c
··· 415 415 416 416 break; 417 417 case PIN_CONFIG_BIAS_HIGH_IMPEDANCE: 418 + param = PM_PINCTRL_CONFIG_TRI_STATE; 419 + arg = PM_PINCTRL_TRI_STATE_ENABLE; 420 + ret = zynqmp_pm_pinctrl_set_config(pin, param, arg); 421 + break; 418 422 case PIN_CONFIG_MODE_LOW_POWER: 419 423 /* 420 424 * These cases are mentioned in dts but configurable ··· 426 422 * boot time warnings as of now. 427 423 */ 428 424 ret = 0; 425 + break; 426 + case PIN_CONFIG_OUTPUT_ENABLE: 427 + param = PM_PINCTRL_CONFIG_TRI_STATE; 428 + arg = PM_PINCTRL_TRI_STATE_DISABLE; 429 + ret = zynqmp_pm_pinctrl_set_config(pin, param, arg); 429 430 break; 430 431 default: 431 432 dev_warn(pctldev->dev,
+4 -2
drivers/pinctrl/pinmux.c
··· 872 872 void *data) 873 873 { 874 874 struct function_desc *function; 875 - int selector; 875 + int selector, error; 876 876 877 877 if (!name) 878 878 return -EINVAL; ··· 892 892 function->num_group_names = num_groups; 893 893 function->data = data; 894 894 895 - radix_tree_insert(&pctldev->pin_function_tree, selector, function); 895 + error = radix_tree_insert(&pctldev->pin_function_tree, selector, function); 896 + if (error) 897 + return error; 896 898 897 899 pctldev->num_functions++; 898 900
-1
drivers/pinctrl/pxa/pinctrl-pxa25x.c
··· 7 7 #include <linux/module.h> 8 8 #include <linux/platform_device.h> 9 9 #include <linux/of.h> 10 - #include <linux/of_device.h> 11 10 #include <linux/pinctrl/pinctrl.h> 12 11 13 12 #include "pinctrl-pxa2xx.h"
-1
drivers/pinctrl/pxa/pinctrl-pxa27x.c
··· 7 7 #include <linux/module.h> 8 8 #include <linux/platform_device.h> 9 9 #include <linux/of.h> 10 - #include <linux/of_device.h> 11 10 #include <linux/pinctrl/pinctrl.h> 12 11 13 12 #include "pinctrl-pxa2xx.h"
+19
drivers/pinctrl/qcom/Kconfig
··· 68 68 Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI 69 69 (Low Power Island) found on the Qualcomm Technologies Inc SC7280 platform. 70 70 71 + config PINCTRL_SM6115_LPASS_LPI 72 + tristate "Qualcomm Technologies Inc SM6115 LPASS LPI pin controller driver" 73 + depends on ARM64 || COMPILE_TEST 74 + depends on PINCTRL_LPASS_LPI 75 + help 76 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 77 + Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI 78 + (Low Power Island) found on the Qualcomm Technologies Inc SM6115 platform. 79 + 71 80 config PINCTRL_SM8250_LPASS_LPI 72 81 tristate "Qualcomm Technologies Inc SM8250 LPASS LPI pin controller driver" 73 82 depends on ARM64 || COMPILE_TEST ··· 85 76 This is the pinctrl, pinmux, pinconf and gpiolib driver for the 86 77 Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI 87 78 (Low Power Island) found on the Qualcomm Technologies Inc SM8250 platform. 79 + 80 + config PINCTRL_SM8350_LPASS_LPI 81 + tristate "Qualcomm Technologies Inc SM8350 LPASS LPI pin controller driver" 82 + depends on ARM64 || COMPILE_TEST 83 + depends on PINCTRL_LPASS_LPI 84 + help 85 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 86 + Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI 87 + (Low Power Island) found on the Qualcomm Technologies Inc SM8350 88 + platform. 88 89 89 90 config PINCTRL_SM8450_LPASS_LPI 90 91 tristate "Qualcomm Technologies Inc SM8450 LPASS LPI pin controller driver"
+2
drivers/pinctrl/qcom/Makefile
··· 44 44 obj-$(CONFIG_PINCTRL_SDX65) += pinctrl-sdx65.o 45 45 obj-$(CONFIG_PINCTRL_SDX75) += pinctrl-sdx75.o 46 46 obj-$(CONFIG_PINCTRL_SM6115) += pinctrl-sm6115.o 47 + obj-$(CONFIG_PINCTRL_SM6115_LPASS_LPI) += pinctrl-sm6115-lpass-lpi.o 47 48 obj-$(CONFIG_PINCTRL_SM6125) += pinctrl-sm6125.o 48 49 obj-$(CONFIG_PINCTRL_SM6350) += pinctrl-sm6350.o 49 50 obj-$(CONFIG_PINCTRL_SM6375) += pinctrl-sm6375.o ··· 53 52 obj-$(CONFIG_PINCTRL_SM8250) += pinctrl-sm8250.o 54 53 obj-$(CONFIG_PINCTRL_SM8250_LPASS_LPI) += pinctrl-sm8250-lpass-lpi.o 55 54 obj-$(CONFIG_PINCTRL_SM8350) += pinctrl-sm8350.o 55 + obj-$(CONFIG_PINCTRL_SM8350_LPASS_LPI) += pinctrl-sm8350-lpass-lpi.o 56 56 obj-$(CONFIG_PINCTRL_SM8450) += pinctrl-sm8450.o 57 57 obj-$(CONFIG_PINCTRL_SM8450_LPASS_LPI) += pinctrl-sm8450-lpass-lpi.o 58 58 obj-$(CONFIG_PINCTRL_SM8550) += pinctrl-sm8550.o
-10
drivers/pinctrl/qcom/pinctrl-ipq5018.c
··· 241 241 "gpio0", "gpio1", "gpio2", "gpio3", "gpio37", 242 242 }; 243 243 244 - static const char * const _groups[] = { 245 - "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 246 - "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 247 - "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 248 - "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 249 - "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 250 - "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 251 - "gpio43", "gpio44", "gpio45", "gpio46", 252 - }; 253 - 254 244 static const char * const wci_txd_groups[] = { 255 245 "gpio0", "gpio1", "gpio2", "gpio3", 256 246 "gpio42", "gpio43", "gpio44", "gpio45",
+3 -6
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
··· 8 8 #include <linux/clk.h> 9 9 #include <linux/gpio/driver.h> 10 10 #include <linux/module.h> 11 - #include <linux/of_device.h> 11 + #include <linux/of.h> 12 + #include <linux/platform_device.h> 12 13 #include <linux/seq_file.h> 13 14 14 15 #include <linux/pinctrl/pinconf-generic.h> ··· 439 438 return dev_err_probe(dev, PTR_ERR(pctrl->slew_base), 440 439 "Slew resource not provided\n"); 441 440 442 - if (of_property_read_bool(dev->of_node, "qcom,adsp-bypass-mode")) 443 - ret = devm_clk_bulk_get_optional(dev, MAX_LPI_NUM_CLKS, pctrl->clks); 444 - else 445 - ret = devm_clk_bulk_get(dev, MAX_LPI_NUM_CLKS, pctrl->clks); 446 - 441 + ret = devm_clk_bulk_get_optional(dev, MAX_LPI_NUM_CLKS, pctrl->clks); 447 442 if (ret) 448 443 return ret; 449 444
-1
drivers/pinctrl/qcom/pinctrl-sdx75.c
··· 5 5 6 6 #include <linux/module.h> 7 7 #include <linux/of.h> 8 - #include <linux/of_device.h> 9 8 #include <linux/platform_device.h> 10 9 #include "pinctrl-msm.h" 11 10
+175
drivers/pinctrl/qcom/pinctrl-sm6115-lpass-lpi.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. 4 + * Copyright (c) 2020, 2023 Linaro Ltd. 5 + */ 6 + 7 + #include <linux/gpio/driver.h> 8 + #include <linux/module.h> 9 + #include <linux/platform_device.h> 10 + 11 + #include "pinctrl-lpass-lpi.h" 12 + 13 + enum lpass_lpi_functions { 14 + LPI_MUX_dmic01_clk, 15 + LPI_MUX_dmic01_data, 16 + LPI_MUX_dmic23_clk, 17 + LPI_MUX_dmic23_data, 18 + LPI_MUX_i2s1_clk, 19 + LPI_MUX_i2s1_data, 20 + LPI_MUX_i2s1_ws, 21 + LPI_MUX_i2s2_clk, 22 + LPI_MUX_i2s2_data, 23 + LPI_MUX_i2s2_ws, 24 + LPI_MUX_i2s3_clk, 25 + LPI_MUX_i2s3_data, 26 + LPI_MUX_i2s3_ws, 27 + LPI_MUX_qua_mi2s_data, 28 + LPI_MUX_qua_mi2s_sclk, 29 + LPI_MUX_qua_mi2s_ws, 30 + LPI_MUX_swr_rx_clk, 31 + LPI_MUX_swr_rx_data, 32 + LPI_MUX_swr_tx_clk, 33 + LPI_MUX_swr_tx_data, 34 + LPI_MUX_wsa_mclk, 35 + LPI_MUX_gpio, 36 + LPI_MUX__, 37 + }; 38 + 39 + static int gpio0_pins[] = { 0 }; 40 + static int gpio1_pins[] = { 1 }; 41 + static int gpio2_pins[] = { 2 }; 42 + static int gpio3_pins[] = { 3 }; 43 + static int gpio4_pins[] = { 4 }; 44 + static int gpio5_pins[] = { 5 }; 45 + static int gpio6_pins[] = { 6 }; 46 + static int gpio7_pins[] = { 7 }; 47 + static int gpio8_pins[] = { 8 }; 48 + static int gpio9_pins[] = { 9 }; 49 + static int gpio10_pins[] = { 10 }; 50 + static int gpio11_pins[] = { 11 }; 51 + static int gpio12_pins[] = { 12 }; 52 + static int gpio13_pins[] = { 13 }; 53 + static int gpio14_pins[] = { 14 }; 54 + static int gpio15_pins[] = { 15 }; 55 + static int gpio16_pins[] = { 16 }; 56 + static int gpio17_pins[] = { 17 }; 57 + static int gpio18_pins[] = { 18 }; 58 + 59 + static const struct pinctrl_pin_desc sm6115_lpi_pins[] = { 60 + PINCTRL_PIN(0, "gpio0"), 61 + PINCTRL_PIN(1, "gpio1"), 62 + PINCTRL_PIN(2, "gpio2"), 63 + PINCTRL_PIN(3, "gpio3"), 64 + PINCTRL_PIN(4, "gpio4"), 65 + PINCTRL_PIN(5, "gpio5"), 66 + PINCTRL_PIN(6, "gpio6"), 67 + PINCTRL_PIN(7, "gpio7"), 68 + PINCTRL_PIN(8, "gpio8"), 69 + PINCTRL_PIN(9, "gpio9"), 70 + PINCTRL_PIN(10, "gpio10"), 71 + PINCTRL_PIN(11, "gpio11"), 72 + PINCTRL_PIN(12, "gpio12"), 73 + PINCTRL_PIN(13, "gpio13"), 74 + PINCTRL_PIN(14, "gpio14"), 75 + PINCTRL_PIN(15, "gpio15"), 76 + PINCTRL_PIN(16, "gpio16"), 77 + PINCTRL_PIN(17, "gpio17"), 78 + PINCTRL_PIN(18, "gpio18"), 79 + }; 80 + 81 + static const char * const dmic01_clk_groups[] = { "gpio6" }; 82 + static const char * const dmic01_data_groups[] = { "gpio7" }; 83 + static const char * const dmic23_clk_groups[] = { "gpio8" }; 84 + static const char * const dmic23_data_groups[] = { "gpio9" }; 85 + static const char * const i2s1_clk_groups[] = { "gpio6" }; 86 + static const char * const i2s1_data_groups[] = { "gpio8", "gpio9" }; 87 + static const char * const i2s1_ws_groups[] = { "gpio7" }; 88 + static const char * const i2s2_clk_groups[] = { "gpio10" }; 89 + static const char * const i2s2_data_groups[] = { "gpio12", "gpio13" }; 90 + static const char * const i2s2_ws_groups[] = { "gpio11" }; 91 + static const char * const i2s3_clk_groups[] = { "gpio14" }; 92 + static const char * const i2s3_data_groups[] = { "gpio16", "gpio17" }; 93 + static const char * const i2s3_ws_groups[] = { "gpio15" }; 94 + static const char * const qua_mi2s_data_groups[] = { "gpio2", "gpio3", "gpio4", "gpio5" }; 95 + static const char * const qua_mi2s_sclk_groups[] = { "gpio0" }; 96 + static const char * const qua_mi2s_ws_groups[] = { "gpio1" }; 97 + static const char * const swr_rx_clk_groups[] = { "gpio3" }; 98 + static const char * const swr_rx_data_groups[] = { "gpio4", "gpio5" }; 99 + static const char * const swr_tx_clk_groups[] = { "gpio0" }; 100 + static const char * const swr_tx_data_groups[] = { "gpio1", "gpio2" }; 101 + static const char * const wsa_mclk_groups[] = { "gpio18" }; 102 + 103 + static const struct lpi_pingroup sm6115_groups[] = { 104 + LPI_PINGROUP(0, 0, swr_tx_clk, qua_mi2s_sclk, _, _), 105 + LPI_PINGROUP(1, 2, swr_tx_data, qua_mi2s_ws, _, _), 106 + LPI_PINGROUP(2, 4, swr_tx_data, qua_mi2s_data, _, _), 107 + LPI_PINGROUP(3, 8, swr_rx_clk, qua_mi2s_data, _, _), 108 + LPI_PINGROUP(4, 10, swr_rx_data, qua_mi2s_data, _, _), 109 + LPI_PINGROUP(5, 12, swr_rx_data, _, qua_mi2s_data, _), 110 + LPI_PINGROUP(6, LPI_NO_SLEW, dmic01_clk, i2s1_clk, _, _), 111 + LPI_PINGROUP(7, LPI_NO_SLEW, dmic01_data, i2s1_ws, _, _), 112 + LPI_PINGROUP(8, LPI_NO_SLEW, dmic23_clk, i2s1_data, _, _), 113 + LPI_PINGROUP(9, LPI_NO_SLEW, dmic23_data, i2s1_data, _, _), 114 + LPI_PINGROUP(10, LPI_NO_SLEW, i2s2_clk, _, _, _), 115 + LPI_PINGROUP(11, LPI_NO_SLEW, i2s2_ws, _, _, _), 116 + LPI_PINGROUP(12, LPI_NO_SLEW, _, i2s2_data, _, _), 117 + LPI_PINGROUP(13, LPI_NO_SLEW, _, i2s2_data, _, _), 118 + LPI_PINGROUP(14, LPI_NO_SLEW, i2s3_clk, _, _, _), 119 + LPI_PINGROUP(15, LPI_NO_SLEW, i2s3_ws, _, _, _), 120 + LPI_PINGROUP(16, LPI_NO_SLEW, i2s3_data, _, _, _), 121 + LPI_PINGROUP(17, LPI_NO_SLEW, i2s3_data, _, _, _), 122 + LPI_PINGROUP(18, 14, wsa_mclk, _, _, _), 123 + }; 124 + 125 + static const struct lpi_function sm6115_functions[] = { 126 + LPI_FUNCTION(dmic01_clk), 127 + LPI_FUNCTION(dmic01_data), 128 + LPI_FUNCTION(dmic23_clk), 129 + LPI_FUNCTION(dmic23_data), 130 + LPI_FUNCTION(i2s1_clk), 131 + LPI_FUNCTION(i2s1_data), 132 + LPI_FUNCTION(i2s1_ws), 133 + LPI_FUNCTION(i2s2_clk), 134 + LPI_FUNCTION(i2s2_data), 135 + LPI_FUNCTION(i2s2_ws), 136 + LPI_FUNCTION(i2s3_clk), 137 + LPI_FUNCTION(i2s3_data), 138 + LPI_FUNCTION(i2s3_ws), 139 + LPI_FUNCTION(qua_mi2s_data), 140 + LPI_FUNCTION(qua_mi2s_sclk), 141 + LPI_FUNCTION(qua_mi2s_ws), 142 + LPI_FUNCTION(swr_rx_clk), 143 + LPI_FUNCTION(swr_rx_data), 144 + LPI_FUNCTION(swr_tx_clk), 145 + LPI_FUNCTION(swr_tx_data), 146 + LPI_FUNCTION(wsa_mclk), 147 + }; 148 + 149 + static const struct lpi_pinctrl_variant_data sm6115_lpi_data = { 150 + .pins = sm6115_lpi_pins, 151 + .npins = ARRAY_SIZE(sm6115_lpi_pins), 152 + .groups = sm6115_groups, 153 + .ngroups = ARRAY_SIZE(sm6115_groups), 154 + .functions = sm6115_functions, 155 + .nfunctions = ARRAY_SIZE(sm6115_functions), 156 + }; 157 + 158 + static const struct of_device_id lpi_pinctrl_of_match[] = { 159 + { .compatible = "qcom,sm6115-lpass-lpi-pinctrl", .data = &sm6115_lpi_data }, 160 + { } 161 + }; 162 + MODULE_DEVICE_TABLE(of, lpi_pinctrl_of_match); 163 + 164 + static struct platform_driver lpi_pinctrl_driver = { 165 + .driver = { 166 + .name = "qcom-sm6115-lpass-lpi-pinctrl", 167 + .of_match_table = lpi_pinctrl_of_match, 168 + }, 169 + .probe = lpi_pinctrl_probe, 170 + .remove = lpi_pinctrl_remove, 171 + }; 172 + 173 + module_platform_driver(lpi_pinctrl_driver); 174 + MODULE_DESCRIPTION("QTI SM6115 LPI GPIO pin control driver"); 175 + MODULE_LICENSE("GPL");
+167
drivers/pinctrl/qcom/pinctrl-sm8350-lpass-lpi.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. 4 + * Copyright (c) 2020-2023 Linaro Ltd. 5 + */ 6 + 7 + #include <linux/gpio/driver.h> 8 + #include <linux/module.h> 9 + #include <linux/platform_device.h> 10 + 11 + #include "pinctrl-lpass-lpi.h" 12 + 13 + enum lpass_lpi_functions { 14 + LPI_MUX_dmic1_clk, 15 + LPI_MUX_dmic1_data, 16 + LPI_MUX_dmic2_clk, 17 + LPI_MUX_dmic2_data, 18 + LPI_MUX_dmic3_clk, 19 + LPI_MUX_dmic3_data, 20 + LPI_MUX_i2s1_clk, 21 + LPI_MUX_i2s1_data, 22 + LPI_MUX_i2s1_ws, 23 + LPI_MUX_i2s2_clk, 24 + LPI_MUX_i2s2_data, 25 + LPI_MUX_i2s2_ws, 26 + LPI_MUX_qua_mi2s_data, 27 + LPI_MUX_qua_mi2s_sclk, 28 + LPI_MUX_qua_mi2s_ws, 29 + LPI_MUX_swr_rx_clk, 30 + LPI_MUX_swr_rx_data, 31 + LPI_MUX_swr_tx_clk, 32 + LPI_MUX_swr_tx_data, 33 + LPI_MUX_wsa_swr_clk, 34 + LPI_MUX_wsa_swr_data, 35 + LPI_MUX_gpio, 36 + LPI_MUX__, 37 + }; 38 + 39 + static int gpio0_pins[] = { 0 }; 40 + static int gpio1_pins[] = { 1 }; 41 + static int gpio2_pins[] = { 2 }; 42 + static int gpio3_pins[] = { 3 }; 43 + static int gpio4_pins[] = { 4 }; 44 + static int gpio5_pins[] = { 5 }; 45 + static int gpio6_pins[] = { 6 }; 46 + static int gpio7_pins[] = { 7 }; 47 + static int gpio8_pins[] = { 8 }; 48 + static int gpio9_pins[] = { 9 }; 49 + static int gpio10_pins[] = { 10 }; 50 + static int gpio11_pins[] = { 11 }; 51 + static int gpio12_pins[] = { 12 }; 52 + static int gpio13_pins[] = { 13 }; 53 + static int gpio14_pins[] = { 14 }; 54 + 55 + static const struct pinctrl_pin_desc sm8350_lpi_pins[] = { 56 + PINCTRL_PIN(0, "gpio0"), 57 + PINCTRL_PIN(1, "gpio1"), 58 + PINCTRL_PIN(2, "gpio2"), 59 + PINCTRL_PIN(3, "gpio3"), 60 + PINCTRL_PIN(4, "gpio4"), 61 + PINCTRL_PIN(5, "gpio5"), 62 + PINCTRL_PIN(6, "gpio6"), 63 + PINCTRL_PIN(7, "gpio7"), 64 + PINCTRL_PIN(8, "gpio8"), 65 + PINCTRL_PIN(9, "gpio9"), 66 + PINCTRL_PIN(10, "gpio10"), 67 + PINCTRL_PIN(11, "gpio11"), 68 + PINCTRL_PIN(12, "gpio12"), 69 + PINCTRL_PIN(13, "gpio13"), 70 + PINCTRL_PIN(14, "gpio14"), 71 + }; 72 + 73 + static const char * const swr_tx_clk_groups[] = { "gpio0" }; 74 + static const char * const swr_tx_data_groups[] = { "gpio1", "gpio2", "gpio5", "gpio14" }; 75 + static const char * const swr_rx_clk_groups[] = { "gpio3" }; 76 + static const char * const swr_rx_data_groups[] = { "gpio4", "gpio5" }; 77 + static const char * const dmic1_clk_groups[] = { "gpio6" }; 78 + static const char * const dmic1_data_groups[] = { "gpio7" }; 79 + static const char * const dmic2_clk_groups[] = { "gpio8" }; 80 + static const char * const dmic2_data_groups[] = { "gpio9" }; 81 + static const char * const i2s2_clk_groups[] = { "gpio10" }; 82 + static const char * const i2s2_ws_groups[] = { "gpio11" }; 83 + static const char * const dmic3_clk_groups[] = { "gpio12" }; 84 + static const char * const dmic3_data_groups[] = { "gpio13" }; 85 + static const char * const qua_mi2s_sclk_groups[] = { "gpio0" }; 86 + static const char * const qua_mi2s_ws_groups[] = { "gpio1" }; 87 + static const char * const qua_mi2s_data_groups[] = { "gpio2", "gpio3", "gpio4" }; 88 + static const char * const i2s1_clk_groups[] = { "gpio6" }; 89 + static const char * const i2s1_ws_groups[] = { "gpio7" }; 90 + static const char * const i2s1_data_groups[] = { "gpio8", "gpio9" }; 91 + static const char * const wsa_swr_clk_groups[] = { "gpio10" }; 92 + static const char * const wsa_swr_data_groups[] = { "gpio11" }; 93 + static const char * const i2s2_data_groups[] = { "gpio12", "gpio12" }; 94 + 95 + static const struct lpi_pingroup sm8350_groups[] = { 96 + LPI_PINGROUP(0, 0, swr_tx_clk, qua_mi2s_sclk, _, _), 97 + LPI_PINGROUP(1, 2, swr_tx_data, qua_mi2s_ws, _, _), 98 + LPI_PINGROUP(2, 4, swr_tx_data, qua_mi2s_data, _, _), 99 + LPI_PINGROUP(3, 8, swr_rx_clk, qua_mi2s_data, _, _), 100 + LPI_PINGROUP(4, 10, swr_rx_data, qua_mi2s_data, _, _), 101 + LPI_PINGROUP(5, 12, swr_tx_data, swr_rx_data, _, _), 102 + LPI_PINGROUP(6, LPI_NO_SLEW, dmic1_clk, i2s1_clk, _, _), 103 + LPI_PINGROUP(7, LPI_NO_SLEW, dmic1_data, i2s1_ws, _, _), 104 + LPI_PINGROUP(8, LPI_NO_SLEW, dmic2_clk, i2s1_data, _, _), 105 + LPI_PINGROUP(9, LPI_NO_SLEW, dmic2_data, i2s1_data, _, _), 106 + LPI_PINGROUP(10, 16, i2s2_clk, wsa_swr_clk, _, _), 107 + LPI_PINGROUP(11, 18, i2s2_ws, wsa_swr_data, _, _), 108 + LPI_PINGROUP(12, LPI_NO_SLEW, dmic3_clk, i2s2_data, _, _), 109 + LPI_PINGROUP(13, LPI_NO_SLEW, dmic3_data, i2s2_data, _, _), 110 + LPI_PINGROUP(14, 6, swr_tx_data, _, _, _), 111 + }; 112 + 113 + static const struct lpi_function sm8350_functions[] = { 114 + LPI_FUNCTION(dmic1_clk), 115 + LPI_FUNCTION(dmic1_data), 116 + LPI_FUNCTION(dmic2_clk), 117 + LPI_FUNCTION(dmic2_data), 118 + LPI_FUNCTION(dmic3_clk), 119 + LPI_FUNCTION(dmic3_data), 120 + LPI_FUNCTION(i2s1_clk), 121 + LPI_FUNCTION(i2s1_data), 122 + LPI_FUNCTION(i2s1_ws), 123 + LPI_FUNCTION(i2s2_clk), 124 + LPI_FUNCTION(i2s2_data), 125 + LPI_FUNCTION(i2s2_ws), 126 + LPI_FUNCTION(qua_mi2s_data), 127 + LPI_FUNCTION(qua_mi2s_sclk), 128 + LPI_FUNCTION(qua_mi2s_ws), 129 + LPI_FUNCTION(swr_rx_clk), 130 + LPI_FUNCTION(swr_rx_data), 131 + LPI_FUNCTION(swr_tx_clk), 132 + LPI_FUNCTION(swr_tx_data), 133 + LPI_FUNCTION(wsa_swr_clk), 134 + LPI_FUNCTION(wsa_swr_data), 135 + }; 136 + 137 + static const struct lpi_pinctrl_variant_data sm8350_lpi_data = { 138 + .pins = sm8350_lpi_pins, 139 + .npins = ARRAY_SIZE(sm8350_lpi_pins), 140 + .groups = sm8350_groups, 141 + .ngroups = ARRAY_SIZE(sm8350_groups), 142 + .functions = sm8350_functions, 143 + .nfunctions = ARRAY_SIZE(sm8350_functions), 144 + }; 145 + 146 + static const struct of_device_id lpi_pinctrl_of_match[] = { 147 + { 148 + .compatible = "qcom,sm8350-lpass-lpi-pinctrl", 149 + .data = &sm8350_lpi_data, 150 + }, 151 + { } 152 + }; 153 + MODULE_DEVICE_TABLE(of, lpi_pinctrl_of_match); 154 + 155 + static struct platform_driver lpi_pinctrl_driver = { 156 + .driver = { 157 + .name = "qcom-sm8350-lpass-lpi-pinctrl", 158 + .of_match_table = lpi_pinctrl_of_match, 159 + }, 160 + .probe = lpi_pinctrl_probe, 161 + .remove = lpi_pinctrl_remove, 162 + }; 163 + module_platform_driver(lpi_pinctrl_driver); 164 + 165 + MODULE_AUTHOR("Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>"); 166 + MODULE_DESCRIPTION("QTI SM8350 LPI GPIO pin control driver"); 167 + MODULE_LICENSE("GPL");
+2
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
··· 1205 1205 { .compatible = "qcom,pm6350-gpio", .data = (void *) 9 }, 1206 1206 { .compatible = "qcom,pm7250b-gpio", .data = (void *) 12 }, 1207 1207 { .compatible = "qcom,pm7325-gpio", .data = (void *) 10 }, 1208 + { .compatible = "qcom,pm7550ba-gpio", .data = (void *) 8}, 1208 1209 { .compatible = "qcom,pm8005-gpio", .data = (void *) 4 }, 1209 1210 { .compatible = "qcom,pm8008-gpio", .data = (void *) 2 }, 1210 1211 { .compatible = "qcom,pm8019-gpio", .data = (void *) 6 }, ··· 1253 1252 /* pmx55 has 11 GPIOs with holes on 3, 7, 10, 11 */ 1254 1253 { .compatible = "qcom,pmx55-gpio", .data = (void *) 11 }, 1255 1254 { .compatible = "qcom,pmx65-gpio", .data = (void *) 16 }, 1255 + { .compatible = "qcom,pmx75-gpio", .data = (void *) 16 }, 1256 1256 { }, 1257 1257 }; 1258 1258
+1 -1
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
··· 7 7 #include <linux/gpio/driver.h> 8 8 #include <linux/interrupt.h> 9 9 #include <linux/module.h> 10 - #include <linux/of_device.h> 10 + #include <linux/of.h> 11 11 #include <linux/of_irq.h> 12 12 #include <linux/platform_device.h> 13 13 #include <linux/regmap.h>
+1 -1
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
··· 7 7 #include <linux/gpio/driver.h> 8 8 #include <linux/interrupt.h> 9 9 #include <linux/module.h> 10 - #include <linux/of_device.h> 10 + #include <linux/of.h> 11 11 #include <linux/of_irq.h> 12 12 #include <linux/platform_device.h> 13 13 #include <linux/regmap.h>
+7 -10
drivers/pinctrl/renesas/core.c
··· 19 19 #include <linux/kernel.h> 20 20 #include <linux/math.h> 21 21 #include <linux/of.h> 22 - #include <linux/of_device.h> 23 22 #include <linux/pinctrl/machine.h> 24 23 #include <linux/platform_device.h> 25 24 #include <linux/psci.h> ··· 648 649 }; 649 650 #endif 650 651 651 - #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM_PSCI_FW) 652 + #if defined(CONFIG_ARM_PSCI_FW) 652 653 static void sh_pfc_nop_reg(struct sh_pfc *pfc, u32 reg, unsigned int idx) 653 654 { 654 655 } ··· 731 732 sh_pfc_walk_regs(pfc, sh_pfc_restore_reg); 732 733 return 0; 733 734 } 734 - 735 - static const struct dev_pm_ops sh_pfc_pm = { 736 - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(sh_pfc_suspend_noirq, sh_pfc_resume_noirq) 737 - }; 738 - #define DEV_PM_OPS &sh_pfc_pm 739 735 #else 740 736 static int sh_pfc_suspend_init(struct sh_pfc *pfc) { return 0; } 741 - #define DEV_PM_OPS NULL 742 - #endif /* CONFIG_PM_SLEEP && CONFIG_ARM_PSCI_FW */ 737 + static int sh_pfc_suspend_noirq(struct device *dev) { return 0; } 738 + static int sh_pfc_resume_noirq(struct device *dev) { return 0; } 739 + #endif /* CONFIG_ARM_PSCI_FW */ 740 + 741 + static DEFINE_NOIRQ_DEV_PM_OPS(sh_pfc_pm, sh_pfc_suspend_noirq, sh_pfc_resume_noirq); 743 742 744 743 #ifdef DEBUG 745 744 #define SH_PFC_MAX_REGS 300 ··· 1415 1418 .driver = { 1416 1419 .name = DRV_NAME, 1417 1420 .of_match_table = of_match_ptr(sh_pfc_of_table), 1418 - .pm = DEV_PM_OPS, 1421 + .pm = pm_sleep_ptr(&sh_pfc_pm), 1419 1422 }, 1420 1423 }; 1421 1424
+1 -2
drivers/pinctrl/renesas/pinctrl-rza1.c
··· 19 19 #include <linux/ioport.h> 20 20 #include <linux/module.h> 21 21 #include <linux/of.h> 22 - #include <linux/of_address.h> 23 - #include <linux/of_device.h> 24 22 #include <linux/pinctrl/pinconf-generic.h> 25 23 #include <linux/pinctrl/pinctrl.h> 26 24 #include <linux/pinctrl/pinmux.h> 25 + #include <linux/platform_device.h> 27 26 #include <linux/property.h> 28 27 #include <linux/slab.h> 29 28
+2 -1
drivers/pinctrl/renesas/pinctrl-rza2.c
··· 15 15 #include <linux/io.h> 16 16 #include <linux/module.h> 17 17 #include <linux/mutex.h> 18 - #include <linux/of_device.h> 18 + #include <linux/of.h> 19 19 #include <linux/pinctrl/pinmux.h> 20 + #include <linux/platform_device.h> 20 21 21 22 #include "../core.h" 22 23 #include "../pinmux.h"
+7 -28
drivers/pinctrl/renesas/pinctrl-rzg2l.c
··· 12 12 #include <linux/io.h> 13 13 #include <linux/module.h> 14 14 #include <linux/mutex.h> 15 - #include <linux/of_device.h> 15 + #include <linux/of.h> 16 16 #include <linux/of_irq.h> 17 + #include <linux/platform_device.h> 17 18 #include <linux/seq_file.h> 18 19 #include <linux/spinlock.h> 19 20 ··· 146 145 const struct rzg2l_pinctrl_data *data; 147 146 void __iomem *base; 148 147 struct device *dev; 149 - struct clk *clk; 150 148 151 149 struct gpio_chip gpio_chip; 152 150 struct pinctrl_gpio_range gpio_range; ··· 1478 1478 return 0; 1479 1479 } 1480 1480 1481 - static void rzg2l_pinctrl_clk_disable(void *data) 1482 - { 1483 - clk_disable_unprepare(data); 1484 - } 1485 - 1486 1481 static int rzg2l_pinctrl_probe(struct platform_device *pdev) 1487 1482 { 1488 1483 struct rzg2l_pinctrl *pctrl; 1484 + struct clk *clk; 1489 1485 int ret; 1490 1486 1491 1487 BUILD_BUG_ON(ARRAY_SIZE(rzg2l_gpio_configs) * RZG2L_PINS_PER_PORT > ··· 1504 1508 if (IS_ERR(pctrl->base)) 1505 1509 return PTR_ERR(pctrl->base); 1506 1510 1507 - pctrl->clk = devm_clk_get(pctrl->dev, NULL); 1508 - if (IS_ERR(pctrl->clk)) { 1509 - ret = PTR_ERR(pctrl->clk); 1510 - dev_err(pctrl->dev, "failed to get GPIO clk : %i\n", ret); 1511 - return ret; 1512 - } 1511 + clk = devm_clk_get_enabled(pctrl->dev, NULL); 1512 + if (IS_ERR(clk)) 1513 + return dev_err_probe(pctrl->dev, PTR_ERR(clk), 1514 + "failed to enable GPIO clk\n"); 1513 1515 1514 1516 spin_lock_init(&pctrl->lock); 1515 1517 spin_lock_init(&pctrl->bitmap_lock); 1516 1518 mutex_init(&pctrl->mutex); 1517 1519 1518 1520 platform_set_drvdata(pdev, pctrl); 1519 - 1520 - ret = clk_prepare_enable(pctrl->clk); 1521 - if (ret) { 1522 - dev_err(pctrl->dev, "failed to enable GPIO clk: %i\n", ret); 1523 - return ret; 1524 - } 1525 - 1526 - ret = devm_add_action_or_reset(&pdev->dev, rzg2l_pinctrl_clk_disable, 1527 - pctrl->clk); 1528 - if (ret) { 1529 - dev_err(pctrl->dev, 1530 - "failed to register GPIO clk disable action, %i\n", 1531 - ret); 1532 - return ret; 1533 - } 1534 1521 1535 1522 ret = rzg2l_pinctrl_register(pctrl); 1536 1523 if (ret)
+7 -28
drivers/pinctrl/renesas/pinctrl-rzv2m.c
··· 15 15 #include <linux/io.h> 16 16 #include <linux/module.h> 17 17 #include <linux/mutex.h> 18 - #include <linux/of_device.h> 18 + #include <linux/of.h> 19 + #include <linux/platform_device.h> 19 20 #include <linux/spinlock.h> 20 21 21 22 #include <linux/pinctrl/consumer.h> ··· 120 119 const struct rzv2m_pinctrl_data *data; 121 120 void __iomem *base; 122 121 struct device *dev; 123 - struct clk *clk; 124 122 125 123 struct gpio_chip gpio_chip; 126 124 struct pinctrl_gpio_range gpio_range; ··· 1047 1047 return 0; 1048 1048 } 1049 1049 1050 - static void rzv2m_pinctrl_clk_disable(void *data) 1051 - { 1052 - clk_disable_unprepare(data); 1053 - } 1054 - 1055 1050 static int rzv2m_pinctrl_probe(struct platform_device *pdev) 1056 1051 { 1057 1052 struct rzv2m_pinctrl *pctrl; 1053 + struct clk *clk; 1058 1054 int ret; 1059 1055 1060 1056 pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); ··· 1067 1071 if (IS_ERR(pctrl->base)) 1068 1072 return PTR_ERR(pctrl->base); 1069 1073 1070 - pctrl->clk = devm_clk_get(pctrl->dev, NULL); 1071 - if (IS_ERR(pctrl->clk)) { 1072 - ret = PTR_ERR(pctrl->clk); 1073 - dev_err(pctrl->dev, "failed to get GPIO clk : %i\n", ret); 1074 - return ret; 1075 - } 1074 + clk = devm_clk_get_enabled(pctrl->dev, NULL); 1075 + if (IS_ERR(clk)) 1076 + return dev_err_probe(pctrl->dev, PTR_ERR(clk), 1077 + "failed to enable GPIO clk\n"); 1076 1078 1077 1079 spin_lock_init(&pctrl->lock); 1078 1080 mutex_init(&pctrl->mutex); 1079 1081 1080 1082 platform_set_drvdata(pdev, pctrl); 1081 - 1082 - ret = clk_prepare_enable(pctrl->clk); 1083 - if (ret) { 1084 - dev_err(pctrl->dev, "failed to enable GPIO clk: %i\n", ret); 1085 - return ret; 1086 - } 1087 - 1088 - ret = devm_add_action_or_reset(&pdev->dev, rzv2m_pinctrl_clk_disable, 1089 - pctrl->clk); 1090 - if (ret) { 1091 - dev_err(pctrl->dev, 1092 - "failed to register GPIO clk disable action, %i\n", 1093 - ret); 1094 - return ret; 1095 - } 1096 1083 1097 1084 ret = rzv2m_pinctrl_register(pctrl); 1098 1085 if (ret)
+1 -1
drivers/pinctrl/samsung/pinctrl-samsung.c
··· 20 20 #include <linux/init.h> 21 21 #include <linux/io.h> 22 22 #include <linux/irqdomain.h> 23 - #include <linux/of_device.h> 23 + #include <linux/of.h> 24 24 #include <linux/platform_device.h> 25 25 #include <linux/property.h> 26 26 #include <linux/seq_file.h>
+1 -1
drivers/pinctrl/spear/pinctrl-spear1310.c
··· 11 11 12 12 #include <linux/err.h> 13 13 #include <linux/init.h> 14 - #include <linux/of_device.h> 14 + #include <linux/mod_devicetable.h> 15 15 #include <linux/platform_device.h> 16 16 #include "pinctrl-spear.h" 17 17
+1 -1
drivers/pinctrl/spear/pinctrl-spear1340.c
··· 11 11 12 12 #include <linux/err.h> 13 13 #include <linux/init.h> 14 - #include <linux/of_device.h> 14 + #include <linux/mod_devicetable.h> 15 15 #include <linux/platform_device.h> 16 16 #include "pinctrl-spear.h" 17 17
+1 -1
drivers/pinctrl/spear/pinctrl-spear300.c
··· 11 11 12 12 #include <linux/err.h> 13 13 #include <linux/init.h> 14 - #include <linux/of_device.h> 14 + #include <linux/mod_devicetable.h> 15 15 #include <linux/platform_device.h> 16 16 #include "pinctrl-spear3xx.h" 17 17
+1 -1
drivers/pinctrl/spear/pinctrl-spear310.c
··· 11 11 12 12 #include <linux/err.h> 13 13 #include <linux/init.h> 14 - #include <linux/of_device.h> 14 + #include <linux/mod_devicetable.h> 15 15 #include <linux/platform_device.h> 16 16 #include "pinctrl-spear3xx.h" 17 17
+1 -1
drivers/pinctrl/spear/pinctrl-spear320.c
··· 11 11 12 12 #include <linux/err.h> 13 13 #include <linux/init.h> 14 - #include <linux/of_device.h> 14 + #include <linux/mod_devicetable.h> 15 15 #include <linux/platform_device.h> 16 16 #include "pinctrl-spear3xx.h" 17 17
-1
drivers/pinctrl/sprd/pinctrl-sprd.c
··· 11 11 #include <linux/kernel.h> 12 12 #include <linux/module.h> 13 13 #include <linux/of.h> 14 - #include <linux/of_device.h> 15 14 #include <linux/platform_device.h> 16 15 #include <linux/seq_file.h> 17 16 #include <linux/slab.h>
+1 -4
drivers/pinctrl/starfive/pinctrl-starfive-jh7110-aon.c
··· 10 10 #include <linux/init.h> 11 11 #include <linux/interrupt.h> 12 12 #include <linux/io.h> 13 + #include <linux/mod_devicetable.h> 13 14 #include <linux/module.h> 14 - #include <linux/of.h> 15 - #include <linux/of_device.h> 16 - #include <linux/of_irq.h> 17 - #include <linux/of_platform.h> 18 15 #include <linux/pinctrl/pinconf.h> 19 16 #include <linux/pinctrl/pinconf-generic.h> 20 17 #include <linux/pinctrl/pinctrl.h>
-2
drivers/pinctrl/starfive/pinctrl-starfive-jh7110-sys.c
··· 13 13 #include <linux/mod_devicetable.h> 14 14 #include <linux/module.h> 15 15 #include <linux/mutex.h> 16 - #include <linux/of.h> 17 - #include <linux/of_device.h> 18 16 #include <linux/platform_device.h> 19 17 #include <linux/reset.h> 20 18 #include <linux/spinlock.h>
-1
drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
··· 14 14 #include <linux/module.h> 15 15 #include <linux/mutex.h> 16 16 #include <linux/of.h> 17 - #include <linux/of_device.h> 18 17 #include <linux/platform_device.h> 19 18 #include <linux/reset.h> 20 19 #include <linux/seq_file.h>
+36 -2
drivers/pinctrl/stm32/pinctrl-stm32.c
··· 13 13 #include <linux/irq.h> 14 14 #include <linux/mfd/syscon.h> 15 15 #include <linux/module.h> 16 - #include <linux/of_address.h> 17 - #include <linux/of_device.h> 18 16 #include <linux/of.h> 17 + #include <linux/of_address.h> 19 18 #include <linux/of_irq.h> 20 19 #include <linux/platform_device.h> 21 20 #include <linux/property.h> ··· 1274 1275 .pin_config_dbg_show = stm32_pconf_dbg_show, 1275 1276 }; 1276 1277 1278 + static struct stm32_desc_pin *stm32_pctrl_get_desc_pin_from_gpio(struct stm32_pinctrl *pctl, 1279 + struct stm32_gpio_bank *bank, 1280 + unsigned int offset) 1281 + { 1282 + unsigned int stm32_pin_nb = bank->bank_nr * STM32_GPIO_PINS_PER_BANK + offset; 1283 + struct stm32_desc_pin *pin_desc; 1284 + int i; 1285 + 1286 + /* With few exceptions (e.g. bank 'Z'), pin number matches with pin index in array */ 1287 + pin_desc = pctl->pins + stm32_pin_nb; 1288 + if (pin_desc->pin.number == stm32_pin_nb) 1289 + return pin_desc; 1290 + 1291 + /* Otherwise, loop all array to find the pin with the right number */ 1292 + for (i = 0; i < pctl->npins; i++) { 1293 + pin_desc = pctl->pins + i; 1294 + if (pin_desc->pin.number == stm32_pin_nb) 1295 + return pin_desc; 1296 + } 1297 + return NULL; 1298 + } 1299 + 1277 1300 static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl, struct fwnode_handle *fwnode) 1278 1301 { 1279 1302 struct stm32_gpio_bank *bank = &pctl->banks[pctl->nbanks]; ··· 1306 1285 struct resource res; 1307 1286 int npins = STM32_GPIO_PINS_PER_BANK; 1308 1287 int bank_nr, err, i = 0; 1288 + struct stm32_desc_pin *stm32_pin; 1289 + char **names; 1309 1290 1310 1291 if (!IS_ERR(bank->rstc)) 1311 1292 reset_control_deassert(bank->rstc); ··· 1376 1353 goto err_clk; 1377 1354 } 1378 1355 } 1356 + 1357 + names = devm_kcalloc(dev, npins, sizeof(char *), GFP_KERNEL); 1358 + for (i = 0; i < npins; i++) { 1359 + stm32_pin = stm32_pctrl_get_desc_pin_from_gpio(pctl, bank, i); 1360 + if (stm32_pin && stm32_pin->pin.name) 1361 + names[i] = devm_kasprintf(dev, GFP_KERNEL, "%s", stm32_pin->pin.name); 1362 + else 1363 + names[i] = NULL; 1364 + } 1365 + 1366 + bank->gpio_chip.names = (const char * const *)names; 1379 1367 1380 1368 err = gpiochip_add_data(&bank->gpio_chip, bank); 1381 1369 if (err) {
-1
drivers/pinctrl/sunplus/sppctl.c
··· 11 11 #include <linux/init.h> 12 12 #include <linux/module.h> 13 13 #include <linux/of.h> 14 - #include <linux/of_device.h> 15 14 #include <linux/overflow.h> 16 15 #include <linux/platform_device.h> 17 16 #include <linux/seq_file.h>
-1
drivers/pinctrl/sunxi/pinctrl-sun20i-d1.c
··· 9 9 #include <linux/module.h> 10 10 #include <linux/platform_device.h> 11 11 #include <linux/of.h> 12 - #include <linux/of_device.h> 13 12 #include <linux/pinctrl/pinctrl.h> 14 13 15 14 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c
··· 13 13 #include <linux/init.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/of.h> 16 - #include <linux/of_device.h> 17 16 #include <linux/pinctrl/pinctrl.h> 18 17 19 18 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun50i-a100-r.c
··· 8 8 9 9 #include <linux/module.h> 10 10 #include <linux/of.h> 11 - #include <linux/of_device.h> 12 11 #include <linux/pinctrl/pinctrl.h> 13 12 #include <linux/platform_device.h> 14 13
-1
drivers/pinctrl/sunxi/pinctrl-sun50i-a100.c
··· 8 8 9 9 #include <linux/module.h> 10 10 #include <linux/of.h> 11 - #include <linux/of_device.h> 12 11 #include <linux/pinctrl/pinctrl.h> 13 12 #include <linux/platform_device.h> 14 13
-1
drivers/pinctrl/sunxi/pinctrl-sun50i-a64-r.c
··· 21 21 */ 22 22 23 23 #include <linux/of.h> 24 - #include <linux/of_device.h> 25 24 #include <linux/pinctrl/pinctrl.h> 26 25 #include <linux/platform_device.h> 27 26
-1
drivers/pinctrl/sunxi/pinctrl-sun50i-a64.c
··· 15 15 #include <linux/module.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/of.h> 18 - #include <linux/of_device.h> 19 18 #include <linux/pinctrl/pinctrl.h> 20 19 21 20 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c
··· 18 18 #include <linux/module.h> 19 19 #include <linux/platform_device.h> 20 20 #include <linux/of.h> 21 - #include <linux/of_device.h> 22 21 #include <linux/pinctrl/pinctrl.h> 23 22 24 23 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/platform_device.h> 16 16 #include <linux/of.h> 17 - #include <linux/of_device.h> 18 17 #include <linux/pinctrl/pinctrl.h> 19 18 20 19 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c
··· 8 8 #include <linux/module.h> 9 9 #include <linux/platform_device.h> 10 10 #include <linux/of.h> 11 - #include <linux/of_device.h> 12 11 #include <linux/pinctrl/pinctrl.h> 13 12 14 13 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun50i-h616-r.c
··· 10 10 #include <linux/init.h> 11 11 #include <linux/platform_device.h> 12 12 #include <linux/of.h> 13 - #include <linux/of_device.h> 14 13 #include <linux/pinctrl/pinctrl.h> 15 14 16 15 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun50i-h616.c
··· 10 10 #include <linux/module.h> 11 11 #include <linux/platform_device.h> 12 12 #include <linux/of.h> 13 - #include <linux/of_device.h> 14 13 #include <linux/pinctrl/pinctrl.h> 15 14 16 15 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun5i.c
··· 12 12 #include <linux/init.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/of.h> 15 - #include <linux/of_device.h> 16 15 #include <linux/pinctrl/pinctrl.h> 17 16 18 17 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c
··· 15 15 #include <linux/init.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/of.h> 18 - #include <linux/of_device.h> 19 18 #include <linux/pinctrl/pinctrl.h> 20 19 21 20 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun6i-a31.c
··· 13 13 #include <linux/init.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/of.h> 16 - #include <linux/of_device.h> 17 16 #include <linux/pinctrl/pinctrl.h> 18 17 19 18 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c
··· 18 18 #include <linux/init.h> 19 19 #include <linux/platform_device.h> 20 20 #include <linux/of.h> 21 - #include <linux/of_device.h> 22 21 #include <linux/pinctrl/pinctrl.h> 23 22 24 23 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c
··· 17 17 #include <linux/init.h> 18 18 #include <linux/platform_device.h> 19 19 #include <linux/of.h> 20 - #include <linux/of_device.h> 21 20 #include <linux/pinctrl/pinctrl.h> 22 21 23 22 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c
··· 15 15 #include <linux/init.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/of.h> 18 - #include <linux/of_device.h> 19 18 #include <linux/pinctrl/pinctrl.h> 20 19 21 20 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun8i-a83t-r.c
··· 24 24 */ 25 25 26 26 #include <linux/of.h> 27 - #include <linux/of_device.h> 28 27 #include <linux/pinctrl/pinctrl.h> 29 28 #include <linux/platform_device.h> 30 29
-1
drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c
··· 15 15 #include <linux/init.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/of.h> 18 - #include <linux/of_device.h> 19 18 #include <linux/pinctrl/pinctrl.h> 20 19 21 20 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun8i-h3-r.c
··· 11 11 #include <linux/module.h> 12 12 #include <linux/platform_device.h> 13 13 #include <linux/of.h> 14 - #include <linux/of_device.h> 15 14 #include <linux/pinctrl/pinctrl.h> 16 15 17 16 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun8i-h3.c
··· 15 15 #include <linux/module.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/of.h> 18 - #include <linux/of_device.h> 19 18 #include <linux/pinctrl/pinctrl.h> 20 19 21 20 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c
··· 18 18 #include <linux/module.h> 19 19 #include <linux/platform_device.h> 20 20 #include <linux/of.h> 21 - #include <linux/of_device.h> 22 21 #include <linux/pinctrl/pinctrl.h> 23 22 24 23 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun9i-a80-r.c
··· 12 12 #include <linux/init.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/of.h> 15 - #include <linux/of_device.h> 16 15 #include <linux/pinctrl/pinctrl.h> 17 16 18 17 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c
··· 13 13 #include <linux/init.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/of.h> 16 - #include <linux/of_device.h> 17 16 #include <linux/pinctrl/pinctrl.h> 18 17 19 18 #include "pinctrl-sunxi.h"
-1
drivers/pinctrl/sunxi/pinctrl-suniv-f1c100s.c
··· 25 25 #include <linux/module.h> 26 26 #include <linux/platform_device.h> 27 27 #include <linux/of.h> 28 - #include <linux/of_device.h> 29 28 #include <linux/pinctrl/pinctrl.h> 30 29 31 30 #include "pinctrl-sunxi.h"
+3 -3
drivers/pinctrl/sunxi/pinctrl-sunxi.c
··· 18 18 #include <linux/irqchip/chained_irq.h> 19 19 #include <linux/irqdomain.h> 20 20 #include <linux/of.h> 21 - #include <linux/of_address.h> 22 21 #include <linux/of_clk.h> 23 - #include <linux/of_device.h> 24 - #include <linux/of_irq.h> 25 22 #include <linux/platform_device.h> 26 23 #include <linux/regulator/consumer.h> 27 24 #include <linux/slab.h> ··· 844 847 struct regulator *reg = s_reg->regulator; 845 848 char supply[16]; 846 849 int ret; 850 + 851 + if (WARN_ON_ONCE(bank_offset >= ARRAY_SIZE(pctl->regulators))) 852 + return -EINVAL; 847 853 848 854 if (reg) { 849 855 refcount_inc(&s_reg->refcount);
+18 -6
drivers/pinctrl/tegra/pinctrl-tegra.c
··· 96 96 {"nvidia,slew-rate-falling", TEGRA_PINCONF_PARAM_SLEW_RATE_FALLING}, 97 97 {"nvidia,slew-rate-rising", TEGRA_PINCONF_PARAM_SLEW_RATE_RISING}, 98 98 {"nvidia,drive-type", TEGRA_PINCONF_PARAM_DRIVE_TYPE}, 99 + {"nvidia,function", TEGRA_PINCONF_PARAM_FUNCTION}, 99 100 }; 100 101 101 102 static int tegra_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev, ··· 471 470 *bit = g->drvtype_bit; 472 471 *width = 2; 473 472 break; 473 + case TEGRA_PINCONF_PARAM_FUNCTION: 474 + *bank = g->mux_bank; 475 + *reg = g->mux_reg; 476 + *bit = g->mux_bit; 477 + *width = 2; 478 + break; 474 479 default: 475 480 dev_err(pmx->dev, "Invalid config param %04x\n", param); 476 481 return -ENOTSUPP; ··· 640 633 val >>= bit; 641 634 val &= (1 << width) - 1; 642 635 643 - seq_printf(s, "\n\t%s=%u", 644 - strip_prefix(cfg_params[i].property), val); 636 + if (cfg_params[i].param == TEGRA_PINCONF_PARAM_FUNCTION) { 637 + u8 idx = pmx->soc->groups[group].funcs[val]; 638 + 639 + seq_printf(s, "\n\t%s=%s", 640 + strip_prefix(cfg_params[i].property), 641 + pmx->functions[idx].name); 642 + } else { 643 + seq_printf(s, "\n\t%s=%u", 644 + strip_prefix(cfg_params[i].property), val); 645 + } 645 646 } 646 647 } 647 648 ··· 762 747 return 0; 763 748 } 764 749 765 - const struct dev_pm_ops tegra_pinctrl_pm = { 766 - .suspend_noirq = &tegra_pinctrl_suspend, 767 - .resume_noirq = &tegra_pinctrl_resume 768 - }; 750 + DEFINE_NOIRQ_DEV_PM_OPS(tegra_pinctrl_pm, tegra_pinctrl_suspend, tegra_pinctrl_resume); 769 751 770 752 static bool tegra_pinctrl_gpio_node_has_range(struct tegra_pmx *pmx) 771 753 {
+2
drivers/pinctrl/tegra/pinctrl-tegra.h
··· 54 54 TEGRA_PINCONF_PARAM_SLEW_RATE_RISING, 55 55 /* argument: Integer, range is HW-dependant */ 56 56 TEGRA_PINCONF_PARAM_DRIVE_TYPE, 57 + /* argument: pinmux settings */ 58 + TEGRA_PINCONF_PARAM_FUNCTION, 57 59 }; 58 60 59 61 enum tegra_pinconf_pull {
-1
drivers/pinctrl/tegra/pinctrl-tegra194.c
··· 16 16 17 17 #include <linux/init.h> 18 18 #include <linux/of.h> 19 - #include <linux/of_device.h> 20 19 #include <linux/platform_device.h> 21 20 #include <linux/pinctrl/pinctrl.h> 22 21 #include <linux/pinctrl/pinmux.h>
+1 -1
drivers/pinctrl/tegra/pinctrl-tegra210.c
··· 1570 1570 .driver = { 1571 1571 .name = "tegra210-pinctrl", 1572 1572 .of_match_table = tegra210_pinctrl_of_match, 1573 - .pm = &tegra_pinctrl_pm, 1573 + .pm = pm_sleep_ptr(&tegra_pinctrl_pm), 1574 1574 }, 1575 1575 .probe = tegra210_pinctrl_probe, 1576 1576 };
+2 -9
drivers/pinctrl/ti/pinctrl-ti-iodelay.c
··· 849 849 iod->reg_data = match->data; 850 850 851 851 /* So far We can assume there is only 1 bank of registers */ 852 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 853 - if (!res) { 854 - dev_err(dev, "Missing MEM resource\n"); 855 - ret = -ENODEV; 856 - goto exit_out; 857 - } 858 - 859 - iod->phys_base = res->start; 860 - iod->reg_base = devm_ioremap_resource(dev, res); 852 + iod->reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); 861 853 if (IS_ERR(iod->reg_base)) { 862 854 ret = PTR_ERR(iod->reg_base); 863 855 goto exit_out; 864 856 } 857 + iod->phys_base = res->start; 865 858 866 859 iod->regmap = devm_regmap_init_mmio(dev, iod->reg_base, 867 860 iod->reg_data->regmap_config);
+72
include/dt-bindings/gpio/amlogic-c3-gpio.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ 2 + /* 3 + * Copyright (c) 2021 Amlogic, Inc. All rights reserved. 4 + * Author: Huqiang Qin <huqiang.qin@amlogic.com> 5 + */ 6 + 7 + #ifndef _DT_BINDINGS_AMLOGIC_C3_GPIO_H 8 + #define _DT_BINDINGS_AMLOGIC_C3_GPIO_H 9 + 10 + #define GPIOE_0 0 11 + #define GPIOE_1 1 12 + #define GPIOE_2 2 13 + #define GPIOE_3 3 14 + #define GPIOE_4 4 15 + 16 + #define GPIOB_0 5 17 + #define GPIOB_1 6 18 + #define GPIOB_2 7 19 + #define GPIOB_3 8 20 + #define GPIOB_4 9 21 + #define GPIOB_5 10 22 + #define GPIOB_6 11 23 + #define GPIOB_7 12 24 + #define GPIOB_8 13 25 + #define GPIOB_9 14 26 + #define GPIOB_10 15 27 + #define GPIOB_11 16 28 + #define GPIOB_12 17 29 + #define GPIOB_13 18 30 + #define GPIOB_14 19 31 + 32 + #define GPIOC_0 20 33 + #define GPIOC_1 21 34 + #define GPIOC_2 22 35 + #define GPIOC_3 23 36 + #define GPIOC_4 24 37 + #define GPIOC_5 25 38 + #define GPIOC_6 26 39 + 40 + #define GPIOX_0 27 41 + #define GPIOX_1 28 42 + #define GPIOX_2 29 43 + #define GPIOX_3 30 44 + #define GPIOX_4 31 45 + #define GPIOX_5 32 46 + #define GPIOX_6 33 47 + #define GPIOX_7 34 48 + #define GPIOX_8 35 49 + #define GPIOX_9 36 50 + #define GPIOX_10 37 51 + #define GPIOX_11 38 52 + #define GPIOX_12 39 53 + #define GPIOX_13 40 54 + 55 + #define GPIOD_0 41 56 + #define GPIOD_1 42 57 + #define GPIOD_2 43 58 + #define GPIOD_3 44 59 + #define GPIOD_4 45 60 + #define GPIOD_5 46 61 + #define GPIOD_6 47 62 + 63 + #define GPIOA_0 48 64 + #define GPIOA_1 49 65 + #define GPIOA_2 50 66 + #define GPIOA_3 51 67 + #define GPIOA_4 52 68 + #define GPIOA_5 53 69 + 70 + #define GPIO_TEST_N 54 71 + 72 + #endif /* _DT_BINDINGS_AMLOGIC_C3_GPIO_H */
+126
include/dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ 2 + /* 3 + * Copyright (c) 2023 Amlogic, Inc. All rights reserved. 4 + * Author: Huqiang Qin <huqiang.qin@amlogic.com> 5 + */ 6 + 7 + #ifndef _DT_BINDINGS_IRQ_MESON_G12A_GPIO_H 8 + #define _DT_BINDINGS_IRQ_MESON_G12A_GPIO_H 9 + 10 + /* IRQID[11:0] - GPIOAO[11:0] */ 11 + #define IRQID_GPIOAO_0 0 12 + #define IRQID_GPIOAO_1 1 13 + #define IRQID_GPIOAO_2 2 14 + #define IRQID_GPIOAO_3 3 15 + #define IRQID_GPIOAO_4 4 16 + #define IRQID_GPIOAO_5 5 17 + #define IRQID_GPIOAO_6 6 18 + #define IRQID_GPIOAO_7 7 19 + #define IRQID_GPIOAO_8 8 20 + #define IRQID_GPIOAO_9 9 21 + #define IRQID_GPIOAO_10 10 22 + #define IRQID_GPIOAO_11 11 23 + 24 + /* IRQID[27:12] - GPIOZ[15:0] */ 25 + #define IRQID_GPIOZ_0 12 26 + #define IRQID_GPIOZ_1 13 27 + #define IRQID_GPIOZ_2 14 28 + #define IRQID_GPIOZ_3 15 29 + #define IRQID_GPIOZ_4 16 30 + #define IRQID_GPIOZ_5 17 31 + #define IRQID_GPIOZ_6 18 32 + #define IRQID_GPIOZ_7 19 33 + #define IRQID_GPIOZ_8 20 34 + #define IRQID_GPIOZ_9 21 35 + #define IRQID_GPIOZ_10 22 36 + #define IRQID_GPIOZ_11 23 37 + #define IRQID_GPIOZ_12 24 38 + #define IRQID_GPIOZ_13 25 39 + #define IRQID_GPIOZ_14 26 40 + #define IRQID_GPIOZ_15 27 41 + 42 + /* IRQID[36:28] - GPIOH[8:0] */ 43 + #define IRQID_GPIOH_0 28 44 + #define IRQID_GPIOH_1 29 45 + #define IRQID_GPIOH_2 30 46 + #define IRQID_GPIOH_3 31 47 + #define IRQID_GPIOH_4 32 48 + #define IRQID_GPIOH_5 33 49 + #define IRQID_GPIOH_6 34 50 + #define IRQID_GPIOH_7 35 51 + #define IRQID_GPIOH_8 36 52 + 53 + /* IRQID[52:37] - BOOT[15:0] */ 54 + #define IRQID_BOOT_0 37 55 + #define IRQID_BOOT_1 38 56 + #define IRQID_BOOT_2 39 57 + #define IRQID_BOOT_3 40 58 + #define IRQID_BOOT_4 41 59 + #define IRQID_BOOT_5 42 60 + #define IRQID_BOOT_6 43 61 + #define IRQID_BOOT_7 44 62 + #define IRQID_BOOT_8 45 63 + #define IRQID_BOOT_9 46 64 + #define IRQID_BOOT_10 47 65 + #define IRQID_BOOT_11 48 66 + #define IRQID_BOOT_12 49 67 + #define IRQID_BOOT_13 50 68 + #define IRQID_BOOT_14 51 69 + #define IRQID_BOOT_15 52 70 + 71 + /* IRQID[60:53] - GPIOC[7:0] */ 72 + #define IRQID_GPIOC_0 53 73 + #define IRQID_GPIOC_1 54 74 + #define IRQID_GPIOC_2 55 75 + #define IRQID_GPIOC_3 56 76 + #define IRQID_GPIOC_4 57 77 + #define IRQID_GPIOC_5 58 78 + #define IRQID_GPIOC_6 59 79 + #define IRQID_GPIOC_7 60 80 + 81 + /* IRQID[76:61] - GPIOA[15:0] */ 82 + #define IRQID_GPIOA_0 61 83 + #define IRQID_GPIOA_1 62 84 + #define IRQID_GPIOA_2 63 85 + #define IRQID_GPIOA_3 64 86 + #define IRQID_GPIOA_4 65 87 + #define IRQID_GPIOA_5 66 88 + #define IRQID_GPIOA_6 67 89 + #define IRQID_GPIOA_7 68 90 + #define IRQID_GPIOA_8 69 91 + #define IRQID_GPIOA_9 70 92 + #define IRQID_GPIOA_10 71 93 + #define IRQID_GPIOA_11 72 94 + #define IRQID_GPIOA_12 73 95 + #define IRQID_GPIOA_13 74 96 + #define IRQID_GPIOA_14 75 97 + #define IRQID_GPIOA_15 76 98 + 99 + /* IRQID[96:77] - GPIOX[19:0] */ 100 + #define IRQID_GPIOX_0 77 101 + #define IRQID_GPIOX_1 78 102 + #define IRQID_GPIOX_2 79 103 + #define IRQID_GPIOX_3 80 104 + #define IRQID_GPIOX_4 81 105 + #define IRQID_GPIOX_5 82 106 + #define IRQID_GPIOX_6 83 107 + #define IRQID_GPIOX_7 84 108 + #define IRQID_GPIOX_8 85 109 + #define IRQID_GPIOX_9 86 110 + #define IRQID_GPIOX_10 87 111 + #define IRQID_GPIOX_11 88 112 + #define IRQID_GPIOX_12 89 113 + #define IRQID_GPIOX_13 90 114 + #define IRQID_GPIOX_14 91 115 + #define IRQID_GPIOX_15 92 116 + #define IRQID_GPIOX_16 93 117 + #define IRQID_GPIOX_17 94 118 + #define IRQID_GPIOX_18 95 119 + #define IRQID_GPIOX_19 96 120 + 121 + /* IRQID[99:97] - GPIOE[2:0] */ 122 + #define IRQID_GPIOE_0 97 123 + #define IRQID_GPIOE_1 98 124 + #define IRQID_GPIOE_2 99 125 + 126 + #endif /* _DT_BINDINGS_IRQ_MESON_G12A_GPIO_H */
+13
include/linux/firmware/xlnx-zynqmp.h
··· 34 34 /* PM API versions */ 35 35 #define PM_API_VERSION_2 2 36 36 37 + #define PM_PINCTRL_PARAM_SET_VERSION 2 38 + 39 + #define ZYNQMP_FAMILY_CODE 0x23 40 + #define VERSAL_FAMILY_CODE 0x26 41 + 42 + /* When all subfamily of platform need to support */ 43 + #define ALL_SUB_FAMILY_CODE 0x00 44 + #define VERSAL_SUB_FAMILY_CODE 0x01 45 + #define VERSALNET_SUB_FAMILY_CODE 0x03 46 + 47 + #define FAMILY_CODE_MASK GENMASK(27, 21) 48 + #define SUB_FAMILY_CODE_MASK GENMASK(20, 19) 49 + 37 50 /* ATF only commands */ 38 51 #define TF_A_PM_REGISTER_SGI 0xa04 39 52 #define PM_GET_TRUSTZONE_VERSION 0xa03
+9
include/linux/pm.h
··· 448 448 SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ 449 449 } 450 450 451 + /* 452 + * Use this if you want to have the suspend and resume callbacks be called 453 + * with IRQs disabled. 454 + */ 455 + #define DEFINE_NOIRQ_DEV_PM_OPS(name, suspend_fn, resume_fn) \ 456 + const struct dev_pm_ops name = { \ 457 + NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ 458 + } 459 + 451 460 #define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr)) 452 461 #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr)) 453 462