# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/i2c/alliedvision,alvium-csi2.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allied Vision Alvium Camera

maintainers:
  - Tommaso Merciai <tomm.merciai@gmail.com>
  - Martin Hecht <martin.hecht@avnet.eu>

allOf:
  - $ref: /schemas/media/video-interface-devices.yaml#

properties:
  compatible:
    const: alliedvision,alvium-csi2

  reg:
    maxItems: 1

  vcc-ext-in-supply:
    description: |
      The regulator that supplies power to the VCC_EXT_IN pins.

  port:
    description: Digital Output Port
    $ref: /schemas/graph.yaml#/$defs/port-base
    additionalProperties: false

    properties:
      endpoint:
        $ref: /schemas/media/video-interfaces.yaml#
        unevaluatedProperties: false

        properties:
          link-frequencies: true

          data-lanes:
            minItems: 1
            items:
              - const: 1
              - const: 2
              - const: 3
              - const: 4

        required:
          - data-lanes
          - link-frequencies

required:
  - compatible
  - reg
  - vcc-ext-in-supply
  - port

additionalProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        alvium: camera@3c {
            compatible = "alliedvision,alvium-csi2";
            reg = <0x3c>;
            vcc-ext-in-supply = <&reg_vcc_ext_in>;

            port {
                alvium_out: endpoint {
                    remote-endpoint = <&mipi_csi_0_in>;
                    data-lanes = <1 2 3 4>;
                    link-frequencies = /bits/ 64 <681250000>;
                };
            };
        };
    };

...
