# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/i2c/sony,imx576.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Sony IMX576 Image Sensor

maintainers:
  - Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>

description:
  IMX576 sensor is a Sony CMOS active pixel digital image sensor with an active
  array size of 5760(H) × 4312(V). It is programmable through an I2C interface.
  Image data is transmitted through MIPI CSI-2. It supports RAW10/RAW8, COMP8
  output formats.

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

properties:
  compatible:
    const: sony,imx576

  reg:
    maxItems: 1

  clocks:
    items:
      - description: INCLK clock

  vana-supply:
    description: Analog Supply Voltage (2.8v)

  vdig-supply:
    description: Digital Supply Voltage (1.05v)

  vif-supply:
    description: Interface Supply Voltage (1.8v)

  reset-gpios:
    maxItems: 1
    description: Reset Pin GPIO Control (active low)

  port:
    description: MIPI CSI-2 transmitter port
    $ref: /schemas/graph.yaml#/$defs/port-base
    additionalProperties: false

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

        properties:
          data-lanes:
            oneOf:
              - items:
                  - const: 1
                  - const: 2
                  - const: 3
                  - const: 4
              - items:
                  - const: 1
                  - const: 2
        required:
          - data-lanes
          - link-frequencies

    required:
      - endpoint

required:
  - compatible
  - reg
  - clocks
  - vana-supply
  - vif-supply
  - vdig-supply
  - port

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/media/video-interfaces.h>

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

        camera-sensor@10 {
            compatible = "sony,imx576";
            reg = <0x10>;
            clocks = <&imx576_clk>;
            reset-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;

            vana-supply = <&vreg_l3p>;
            vif-supply = <&vreg_l6p>;
            vdig-supply = <&vreg_32m_cam_dvdd_1p05>;

            orientation = <0>;
            rotation = <90>;

            port {
                cam_out: endpoint {
                   remote-endpoint = <&csiphy3_ep>;
                   data-lanes = <1 2 3 4>;
                   link-frequencies = /bits/ 64 <1017000000>;
                };
            };
        };
    };