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

title: OmniVision OS05B10 Image Sensor

maintainers:
  - Elgin Perumbilly <elgin.perumbilly@siliconsignals.io>

description:
  The OmniVision OS05B10 is a 5MP (2592x1944) color CMOS image sensor controlled
  through an I2C-compatible SCCB bus. it outputs RAW10/RAW12 format and uses a
  1/2.78" optical format.

properties:
  compatible:
    const: ovti,os05b10

  reg:
    maxItems: 1

  clocks:
    items:
      - description: XCLK clock

  avdd-supply:
    description: Analog Domain Power Supply (2.8v)

  dovdd-supply:
    description: I/O Domain Power Supply (1.8v)

  dvdd-supply:
    description: Digital Domain Power Supply (1.2v)

  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:
  - compatible
  - reg
  - clocks
  - avdd-supply
  - dovdd-supply
  - dvdd-supply
  - port

additionalProperties: false

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

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

        camera-sensor@36 {
            compatible = "ovti,os05b10";
            reg = <0x36>;
            clocks = <&os05b10_clk>;
            reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;

            avdd-supply = <&os05b10_avdd_2v8>;
            dvdd-supply = <&os05b10_dvdd_1v2>;
            dovdd-supply = <&os05b10_dovdd_1v8>;

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