// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd
 */

/dts-v1/;
#include "rk3326.dtsi"
#include "px30-android.dtsi"
#include "rk3326-evb-lp3-v10.dtsi"
#include "rk3326-863-cif-sensor.dtsi"

/ {
	model = "Rockchip rk3326 evb board";
	compatible = "rockchip,rk3326-evb-lp3-v10-avb", "rockchip,rk3326";
};

&i2c2 {
	status = "okay";

	clock-frequency = <100000>;

	/* These are relatively safe rise/fall times; TODO: measure */
	i2c-scl-falling-time-ns = <50>;
	i2c-scl-rising-time-ns = <300>;

	ov5695: ov5695@36 {
		compatible = "ovti,ov5695";
		reg = <0x36>;
		clocks = <&cru SCLK_CIF_OUT>;
		clock-names = "xvclk";
		/*reset-gpios = <&gpio2 14 GPIO_ACTIVE_HIGH>;*/
		pwdn-gpios = <&gpio2 14 GPIO_ACTIVE_HIGH>;
		//pinctrl-names = "default";
		//pinctrl-0 = <&cif_clkout_m0>;
		rockchip,camera-module-index = <0>;
		rockchip,camera-module-facing = "back";
		rockchip,camera-module-name = "TongJu";
		rockchip,camera-module-lens-name = "CHT842-MD";
		port {
			ov5695_out: endpoint {
				remote-endpoint = <&mipi_in>;
				data-lanes = <1 2>;
			};
		};
	};
};

&mipi_dphy_rx0 {
	status = "okay";

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

		port@0 {
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <0>;

			mipi_in: endpoint@1 {
				reg = <1>;
				remote-endpoint = <&ov5695_out>;
				data-lanes = <1 2>;
			};
		};

		port@1 {
			reg = <1>;
			#address-cells = <1>;
			#size-cells = <0>;

			dphy_rx_out: endpoint@0 {
				reg = <0>;
				remote-endpoint = <&isp_mipi_in>;
			};
		};
	};
};

&rkisp1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&cif_clkout_m0 &dvp_d2d9_m0>;
	port {
		#address-cells = <1>;
		#size-cells = <0>;

		isp_mipi_in: endpoint@0 {
			reg = <0>;
			remote-endpoint = <&dphy_rx_out>;
		};

	};
};
