# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/i2c/hm5065.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Himax HM5065 CSI camera sensor

description: |+
  At least one of reset-gpios and enable-gpios must be configured.

  The device node must contain one 'port' child node for its digital output
  video port, in accordance with the video interface bindings defined in
  
  Documentation/devicetree/bindings/media/video-interfaces.txt.

maintainers:
  - Ondrej Jirman <megi@xff.cz>

properties:
  compatible:
    const: himax,hm5065

  reg:
    maxItems: 1

  reset-gpios:
    maxItems: 1
    description: reference to the GPIO connected to the reset pin, if any. This is an active low signal to the HM5065.

  enable-gpios:
    maxItems: 1
    description: reference to the GPIO connected to the CE pin, if any. This is an active high signal to the HM5065.

  IOVDD-supply:
    description: Digital I/O voltage supply, 2.8 volts

  AVDD-supply:
    description: Analog voltage supply, 2.8 volts

  DVDD-supply:
    description: Digital core voltage supply, 1.8 volts

  AFVDD-supply:
    description: Auto focus voltage supply, 2.8 volts

  clocks:
    minItems: 1
    maxItems: 1
    description: reference to the external input clock for the sensor.

- clock-names: should be "xclk".

required:
  - compatible
  - reg
  - clocks
  - clock-names
  - IOVDD-supply
  - AVDD-supply
  - DVDD-supply
  - AFVDD-supply

Example:

&i2c1 {
	hm5065: camera@1f {
		compatible = "himax,hm5065";
		reg = <0x1f>;
		clocks = <&ccu CLK_CSI_MCLK>;
		clock-names = "xclk";
		IOVDD-supply = <&reg_dldo3>;
		AVDD-supply = <&reg_dldo4>;
		DVDD-supply = <&reg_eldo3>;
		AFVDD-supply = <&reg_dldo3>;
		reset-gpios = <&pio 4 18 GPIO_ACTIVE_LOW>; /* PE18 */
		enable-gpios = <&pio 4 19 GPIO_ACTIVE_HIGH>; /* PE19 */

		port {
			hm5065_ep: endpoint {
				remote-endpoint = <&csi0_hm5065_ep>;
				bus-width = <8>;
				hsync-active = <1>;
				vsync-active = <1>;
				data-active = <1>;
				pclk-sample = <1>;
			};
		};
	};
};
