# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/amlogic,meson-pinctrl-common.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Amlogic Meson pinmux controller

maintainers:
  - Neil Armstrong <neil.armstrong@linaro.org>

allOf:
  - $ref: pinctrl.yaml#

properties:
  ranges: true

  "#address-cells":
    enum: [1, 2]

  "#size-cells":
    enum: [1, 2]

required:
  - ranges
  - "#address-cells"
  - "#size-cells"

additionalProperties: true

$defs:
  meson-gpio:
    type: object

    properties:
      gpio-controller: true

      "#gpio-cells":
        const: 2

      gpio-ranges:
        maxItems: 1

    patternProperties:
      "^.+-hog(-[0-9]+)?$":
        type: object

        required:
          - gpio-hog

    required:
      - reg
      - reg-names
      - gpio-controller
      - "#gpio-cells"
      - gpio-ranges

  meson-pins:
    type: object
    additionalProperties:
      type: object
      allOf:
        - $ref: pincfg-node.yaml#
        - $ref: pinmux-node.yaml#