# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/marvell,armada-7k-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Marvell Armada 7K/8K pin controller

maintainers:
  - Gregory Clement <gregory.clement@bootlin.com>
  - Miquel Raynal <miquel.raynal@bootlin.com>

properties:
  compatible:
    enum:
      - marvell,armada-7k-pinctrl
      - marvell,armada-8k-cpm-pinctrl
      - marvell,armada-8k-cps-pinctrl
      - marvell,cp115-standalone-pinctrl

  reg:
    maxItems: 1

patternProperties:
  '-pins(-.+)?$':
    type: object
    additionalProperties: false

    properties:
      marvell,function:
        $ref: /schemas/types.yaml#/definitions/string
        description:
          Indicates the function to select.
        enum: [
          au, dev, ge, ge0, ge1, gpio, i2c0, i2c1, led, link, mii, mss_gpio0,
          mss_gpio1, mss_gpio2, mss_gpio3, mss_gpio4, mss_gpio5, mss_gpio6,
          mss_gpio7, mss_i2c, mss_spi, mss_uart, nf, pcie, pcie0, pcie1, pcie2,
          ptp, rei, sata0, sata1, sdio, sdio_cd, sdio_wp, sei, spi0, spi1,
          synce1, synce2, tdm, uart0, uart1, uart2, uart3, wakeup, xg
        ]

      marvell,pins:
        $ref: /schemas/types.yaml#/definitions/string-array
        description:
          Array of MPP pins to be used for the given function.
        minItems: 1
        maxItems: 63
        items:
          pattern: '^mpp([1-5]?[0-9]|6[0-2])$'

allOf:
  - $ref: pinctrl.yaml#

required:
  - compatible

additionalProperties: false

examples:
  - |
    pinctrl {
        compatible = "marvell,armada-7k-pinctrl";

        nand_pins: nand-pins {
            marvell,pins =
                "mpp15", "mpp16", "mpp17", "mpp18",
                "mpp19", "mpp20", "mpp21", "mpp22",
                "mpp23", "mpp24", "mpp25", "mpp26",
                "mpp27";
            marvell,function = "dev";
        };
    };
