Commit a32b344e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull pin control updates from Linus Walleij:
 "This is the bulk of pin control changes for the v5.14 kernel. Not so
  much going on. No core changes, just drivers.

  The most interesting would be that MIPS Ralink is migrating to pin
  control and we have some bindings but not yet code for the Apple M1
  pin controller.

  New drivers:

   - Last merge window we created a driver for the Ralink RT2880. We are
     now moving the Ralink SoC pin control drivers out of the MIPS
     architecture code and into the pin control subsystem. This concerns
     RT288X, MT7620, RT305X, RT3883 and MT7621.

   - Qualcomm SM6125 SoC pin control driver.

   - Qualcomm spmi-gpio support for PM7325.

   - Qualcomm spmi-mpp also handles PMI8994 (just a compatible string)

   - Mediatek MT8365 SoC pin controller.

   - New device HID for the AMD GPIO controller.

  Improvements:

   - Pin bias config support for a slew of Renesas pin controllers.

   - Incremental improvements and non-urgent bug fixes to the Renesas
     SoC drivers.

   - Implement irq_set_wake on the AMD pin controller so we can wake up
     from external pin events.

  Misc:

   - Devicetree bindings for the Apple M1 pin controller, we will
     probably see a proper driver for this soon as well"

* tag 'pinctrl-v5.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (54 commits)
  pinctrl: ralink: rt305x: add missing include
  pinctrl: stm32: check for IRQ MUX validity during alloc()
  pinctrl: zynqmp: some code cleanups
  drivers: qcom: pinctrl: Add pinctrl driver for sm6125
  dt-bindings: pinctrl: qcom: sm6125: Document SM6125 pinctrl driver
  dt-bindings: pinctrl: mcp23s08: add documentation for reset-gpios
  pinctrl: mcp23s08: Add optional reset GPIO
  pinctrl: mediatek: fix mode encoding
  pinctrl: mcp23s08: Fix missing unlock on error in mcp23s08_irq()
  pinctrl: bcm: Constify static pinmux_ops
  pinctrl: bcm: Constify static pinctrl_ops
  pinctrl: ralink: move RT288X SoC pinmux config into a new 'pinctrl-rt288x.c' file
  pinctrl: ralink: move MT7620 SoC pinmux config into a new 'pinctrl-mt7620.c' file
  pinctrl: ralink: move RT305X SoC pinmux config into a new 'pinctrl-rt305x.c' file
  pinctrl: ralink: move RT3883 SoC pinmux config into a new 'pinctrl-rt3883.c' file
  pinctrl: ralink: move MT7621 SoC pinmux config into a new 'pinctrl-mt7621.c' file
  pinctrl: ralink: move ralink architecture pinmux header into the driver
  pinctrl: single: config: enable the pin's input
  pinctrl: mtk: Fix mt8365 Kconfig dependency
  pinctrl: mcp23s08: fix race condition in irq handler
  ...
parents e04360a2 bfa50166
Loading
Loading
Loading
Loading
+106 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/apple,pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple GPIO controller

maintainers:
  - Mark Kettenis <kettenis@openbsd.org>

description: |
  The Apple GPIO controller is a simple combined pin and GPIO
  controller present on Apple ARM SoC platforms, including various
  iPhone and iPad devices and the "Apple Silicon" Macs.

properties:
  compatible:
    items:
      - const: apple,t8103-pinctrl
      - const: apple,pinctrl

  reg:
    maxItems: 1

  clocks:
    maxItems: 1

  gpio-controller: true

  '#gpio-cells':
    const: 2

  gpio-ranges:
    maxItems: 1

  interrupts:
    description: One interrupt for each of the (up to 7) interrupt
      groups supported by the controller sorted by interrupt group
      number in ascending order.
    minItems: 1
    maxItems: 7

  interrupt-controller: true

patternProperties:
  '-pins$':
    type: object
    $ref: pinmux-node.yaml#

    properties:
      pinmux:
        description:
          Values are constructed from pin number and alternate function
          configuration number using the APPLE_PINMUX() helper macro
          defined in include/dt-bindings/pinctrl/apple.h.

    required:
      - pinmux

    additionalProperties: false

required:
  - compatible
  - reg
  - gpio-controller
  - '#gpio-cells'
  - gpio-ranges

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/apple-aic.h>
    #include <dt-bindings/pinctrl/apple.h>

    soc {
      #address-cells = <2>;
      #size-cells = <2>;

      pinctrl: pinctrl@23c100000 {
        compatible = "apple,t8103-pinctrl", "apple,pinctrl";
        reg = <0x2 0x3c100000 0x0 0x100000>;
        clocks = <&gpio_clk>;

        gpio-controller;
        #gpio-cells = <2>;
        gpio-ranges = <&pinctrl 0 0 212>;

        interrupt-controller;
        interrupt-parent = <&aic>;
        interrupts = <AIC_IRQ 16 IRQ_TYPE_LEVEL_HIGH>,
                     <AIC_IRQ 17 IRQ_TYPE_LEVEL_HIGH>,
                     <AIC_IRQ 18 IRQ_TYPE_LEVEL_HIGH>,
                     <AIC_IRQ 19 IRQ_TYPE_LEVEL_HIGH>,
                     <AIC_IRQ 20 IRQ_TYPE_LEVEL_HIGH>,
                     <AIC_IRQ 21 IRQ_TYPE_LEVEL_HIGH>,
                     <AIC_IRQ 22 IRQ_TYPE_LEVEL_HIGH>;

        pcie_pins: pcie-pins {
          pinmux = <APPLE_PINMUX(150, 1)>,
                   <APPLE_PINMUX(151, 1)>,
                   <APPLE_PINMUX(32, 1)>;
        };
      };
    };
+5 −5
Original line number Diff line number Diff line
@@ -46,8 +46,8 @@ patternProperties:
                  PWM9, RGMII1, RGMII2, RGMII3, RGMII4, RMII1, RMII2, RMII3, RMII4,
                  RXD1, RXD2, RXD3, RXD4, SALT1, SALT10, SALT11, SALT12, SALT13, SALT14,
                  SALT15, SALT16, SALT2, SALT3, SALT4, SALT5, SALT6, SALT7, SALT8,
                  SALT9, SD1, SD2, SGPM1, SGPS1, SIOONCTRL, SIOPBI, SIOPBO, SIOPWREQ,
                  SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, SPI1ABR, SPI1CS1, SPI1WP, SPI2,
                  SALT9, SD1, SD2, SGPM1, SGPM2, SGPS1, SGPS2, SIOONCTRL, SIOPBI, SIOPBO,
                  SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, SPI1ABR, SPI1CS1, SPI1WP, SPI2,
                  SPI2CS1, SPI2CS2, TACH0, TACH1, TACH10, TACH11, TACH12, TACH13, TACH14,
                  TACH15, TACH2, TACH3, TACH4, TACH5, TACH6, TACH7, TACH8, TACH9, THRU0,
                  THRU1, THRU2, THRU3, TXD1, TXD2, TXD3, TXD4, UART10, UART11, UART12,
@@ -74,9 +74,9 @@ patternProperties:
                  RXD1, RXD2, RXD3, RXD4, SALT1, SALT10G0, SALT10G1, SALT11G0, SALT11G1,
                  SALT12G0, SALT12G1, SALT13G0, SALT13G1, SALT14G0, SALT14G1, SALT15G0,
                  SALT15G1, SALT16G0, SALT16G1, SALT2, SALT3, SALT4, SALT5, SALT6,
                  SALT7, SALT8, SALT9G0, SALT9G1, SD1, SD2, SD3, SGPM1, SGPS1, SIOONCTRL,
                  SIOPBI, SIOPBO, SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1, SPI1ABR,
                  SPI1CS1, SPI1WP, SPI2, SPI2CS1, SPI2CS2, TACH0, TACH1, TACH10, TACH11,
                  SALT7, SALT8, SALT9G0, SALT9G1, SD1, SD2, SD3, SGPM1, SGPM2, SGPS1, SGPS2,
                  SIOONCTRL, SIOPBI, SIOPBO, SIOPWREQ, SIOPWRGD, SIOS3, SIOS5, SIOSCI, SPI1,
                  SPI1ABR, SPI1CS1, SPI1WP, SPI2, SPI2CS1, SPI2CS2, TACH0, TACH1, TACH10, TACH11,
                  TACH12, TACH13, TACH14, TACH15, TACH2, TACH3, TACH4, TACH5, TACH6,
                  TACH7, TACH8, TACH9, THRU0, THRU1, THRU2, THRU3, TXD1, TXD2, TXD3,
                  TXD4, UART10, UART11, UART12G0, UART12G1, UART13G0, UART13G1, UART6,
+0 −55
Original line number Diff line number Diff line
Broadcom Northstar pins mux controller

Some of Northstar SoCs's pins can be used for various purposes thanks to the mux
controller. This binding allows describing mux controller and listing available
functions. They can be referenced later by other bindings to let system
configure controller correctly.

A list of pins varies across chipsets so few bindings are available.

Node of the pinmux must be nested in the CRU (Central Resource Unit) "syscon"
noce.

Required properties:
- compatible: must be one of:
	"brcm,bcm4708-pinmux"
	"brcm,bcm4709-pinmux"
	"brcm,bcm53012-pinmux"
- offset: offset of pin registers in the CRU block

Functions and their groups available for all chipsets:
- "spi": "spi_grp"
- "i2c": "i2c_grp"
- "pwm": "pwm0_grp", "pwm1_grp", "pwm2_grp", "pwm3_grp"
- "uart1": "uart1_grp"

Additionally available on BCM4709 and BCM53012:
- "mdio": "mdio_grp"
- "uart2": "uart2_grp"
- "sdio": "sdio_pwr_grp", "sdio_1p8v_grp"

For documentation of subnodes see:
Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt

Example:
	dmu@1800c000 {
		compatible = "simple-bus";
		ranges = <0 0x1800c000 0x1000>;
		#address-cells = <1>;
		#size-cells = <1>;

		cru@100 {
			compatible = "syscon", "simple-mfd";
			reg = <0x100 0x1a4>;

			pinctrl {
				compatible = "brcm,bcm4708-pinmux";
				offset = <0xc0>;

				spi-pins {
					function = "spi";
					groups = "spi_grp";
				};
			};
		};
	};
+94 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/brcm,ns-pinmux.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Broadcom Northstar pins mux controller

maintainers:
  - Rafał Miłecki <rafal@milecki.pl>

description:
  Some of Northstar SoCs's pins can be used for various purposes thanks to the
  mux controller. This binding allows describing mux controller and listing
  available functions. They can be referenced later by other bindings to let
  system configure controller correctly.

  A list of pins varies across chipsets so few bindings are available.

  Node of the pinmux must be nested in the CRU (Central Resource Unit) "syscon"
  node.

properties:
  compatible:
    enum:
      - brcm,bcm4708-pinmux
      - brcm,bcm4709-pinmux
      - brcm,bcm53012-pinmux

  offset:
    description: offset of pin registers in the CRU block
    maxItems: 1
    $ref: /schemas/types.yaml#/definitions/uint32-array

patternProperties:
  '-pins$':
    type: object
    description: pin node
    $ref: pinmux-node.yaml#

    properties:
      function:
        enum: [ spi, i2c, pwm, uart1, mdio, uart2, sdio ]
      groups:
        minItems: 1
        maxItems: 4
        items:
          enum: [ spi_grp, i2c_grp, pwm0_grp, pwm1_grp, pwm2_grp, pwm3_grp,
                  uart1_grp, mdio_grp, uart2_grp, sdio_pwr_grp, sdio_1p8v_grp ]

    required:
      - function
      - groups

    additionalProperties: false

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: brcm,bcm4708-pinmux
    then:
      patternProperties:
        '-pins$':
          properties:
            function:
              enum: [ spi, i2c, pwm, uart1 ]
            groups:
              items:
                enum: [ spi_grp, i2c_grp, pwm0_grp, pwm1_grp, pwm2_grp, pwm3_grp,
                        uart1_grp ]

required:
  - offset

additionalProperties: false

examples:
  - |
    cru@1800c100 {
        compatible = "syscon", "simple-mfd";
        reg = <0x1800c100 0x1a4>;

        pinctrl {
            compatible = "brcm,bcm4708-pinmux";
            offset = <0xc0>;

            spi-pins {
                function = "spi";
                groups = "spi_grp";
            };
        };
    };
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ Optional properties:
- interrupt-controller: Marks the device node as a interrupt controller.
- drive-open-drain: Sets the ODR flag in the IOCON register. This configures
        the IRQ output as open drain active low.
- reset-gpios: Corresponds to the active-low RESET# pin for the chip

Optional device specific properties:
- microchip,irq-mirror: Sets the mirror flag in the IOCON register. Devices
@@ -135,6 +136,7 @@ gpio21: gpio@21 {
	microchip,irq-mirror;
	pinctrl-names = "default";
	pinctrl-0 = <&i2cgpio0irq>, <&gpio21pullups>;
	reset-gpios = <&gpio6 15 GPIO_ACTIVE_LOW>;

	gpio21pullups: pinmux {
		pins =	"gpio0", "gpio1", "gpio2", "gpio3",
Loading