summaryrefslogtreecommitdiff
path: root/overlays/toradex-smarc-imx8mp_csi1-ov5640-27mhz_overlay.dts
blob: e92fcbc197adccf6451c08e65ebf3a7eb7729600 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
 * Copyright (C) 2025 Toradex
 *
 * CSI Camera Module OV5640 with 27MHz Oscillator
 *
 * https://developer.toradex.com/hardware/accessories/cameras/csi-camera-module-5mp-ov5640-arducam
 */

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>

/ {
	compatible = "toradex,smarc-imx8mp";
};

&{/} {
	clk_csi_1_ov5640: ov5640-csi-1-clock {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <27000000>;
	};

	regulator_camera_csi_1: regulator-camera-csi-1 {
		compatible = "regulator-fixed";
		/* SMARC GPIO1 as CAM1_PWR# - Camera Connector 24 */
		gpios = <&som_gpio_expander 1 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		regulator-name = "V_CSI";
		startup-delay-us = <5000>;
	};
};

/* SMARC I2C_CAM1 */
&i2c5 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	camera@3c {
		compatible = "ovti,ov5640";
		reg = <0x3c>;
		clocks = <&clk_csi_1_ov5640>;
		clock-names = "xclk";
		/* SMARC GPIO3 as CAM1_RST# - Camera Connector 11 */
		reset-gpios = <&som_gpio_expander 3 GPIO_ACTIVE_LOW>;
		AVDD-supply = <&regulator_camera_csi_1>;
		DVDD-supply = <&regulator_camera_csi_1>;
		DOVDD-supply = <&regulator_camera_csi_1>;
		PVDD-supply = <&regulator_camera_csi_1>;

		port {
			ov5640_cam1_ep: endpoint {
				clock-lanes = <0>;
				data-lanes = <1 2>;
				remote-endpoint = <&mipi_csi_0_ep>;
			};
		};
	};
};

&isi_0 {
	status = "okay";
};

/* SMARC CSI1 */
&mipi_csi_0 {
	status = "okay";

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

		port@0 {
			reg = <0>;

			mipi_csi_0_ep: endpoint {
				data-lanes = <1 2>;
				remote-endpoint = <&ov5640_cam1_ep>;
			};
		};
	};
};