summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/media/i2c/ov5640.txt
blob: e37fef7bc6c2c787d244363d9b52316172904fb9 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
* Omnivision OV5640 image sensor

The Omnivision OV5640 is a 1/4" color CMOS QSXGA 5 megapixel image sensor.
All image processing functions are programmable through the SCCB interface
or embedded microcontroller.
The OV5640 supports both a digital video parallel port and a dual lane
serial MIPI port.

The OV5640 sensor supports multiple resolutions output, such as QSXGA, 1080p,
720p, VGA, QVGA. It also can support YUV422/420, YCbCr422, RGB565/555/444,
CCIR656 or raw RGB output formats.


Required Properties:
- compatible: should be "ovti,ov5640_mipi"
- clocks: reference to the csi_mclk input clock.
- clock-names: should be "csi_mclk".
- reg: I2C slave address
- csi-id: virtual channel for this sensor
- mclk: used to calculate xvclk (sensor master input clock, xvclk = mclk /10000)


Optional Properties:
- rst-gpios: reference to the GPIO connected to the resetb pin, if any.
- pwn-gpios: reference to the GPIO connected to the pwdn pin, if any.

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.

Please note that the default I2C slave address is 0x3c.
In case dual-camera is used, it might be necessary to change
the I2C slave address for both cameras, and disable the reset pin,
this is if the board has only one reset line for both cameras, for
example imx-8mq-evk rev B3. Also, unique csi-id is needed for each
camera. See the dual-camera example.


Example for single camera:

i2c1: i2c@30a20000 {
	ov5640_mipi: ov5640_mipi@3c {
		compatible = "ovti,ov5640_mipi";
		reg = <0x3c>;
		status = "okay";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_csi1_pwn>, <&pinctrl_csi_rst>;
		clocks = <&clk IMX8MQ_CLK_CLKO2_DIV>;
		clock-names = "csi_mclk";
		assigned-clocks = <&clk IMX8MQ_CLK_CLKO2_SRC>,
				  <&clk IMX8MQ_CLK_CLKO2_DIV>;
		assigned-clock-parents = <&clk IMX8MQ_SYS2_PLL_200M>;
		assigned-clock-rates = <0>, <20000000>;
		csi_id = <0>;
		pwn-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
		rst-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
		mclk = <20000000>;
		mclk_source = <0>;
		port {
			ov5640_mipi1_ep: endpoint {
				remote-endpoint = <&mipi1_sensor_ep>;
			};
		};
	};


Example for dual-camera:

	ov5640_mipi: ov5640_mipi@1c {
		compatible = "ovti,ov5640_mipi";
		reg = <0x1c>;
		status = "okay";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_csi1_pwn>, <&pinctrl_csi_rst>;
		clocks = <&clk IMX8MQ_CLK_CLKO2_DIV>;
		clock-names = "csi_mclk";
		assigned-clocks = <&clk IMX8MQ_CLK_CLKO2_SRC>,
				  <&clk IMX8MQ_CLK_CLKO2_DIV>;
		assigned-clock-parents = <&clk IMX8MQ_SYS2_PLL_200M>;
		assigned-clock-rates = <0>, <20000000>;
		csi_id = <0>;
		pwn-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
		mclk = <20000000>;
		mclk_source = <0>;
		port {
			ov5640_mipi1_ep: endpoint {
				remote-endpoint = <&mipi1_sensor_ep>;
			};
		};
	};

	ov5640_mipi2: ov5640_mipi2@2c {
		compatible = "ovti,ov5640_mipi";
		reg = <0x2c>;
		status = "okay";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_csi2_pwn>;
		clocks = <&clk IMX8MQ_CLK_CLKO2_DIV>;
		clock-names = "csi_mclk";
		assigned-clocks = <&clk IMX8MQ_CLK_CLKO2_SRC>,
				  <&clk IMX8MQ_CLK_CLKO2_DIV>;
		assigned-clock-parents = <&clk IMX8MQ_SYS2_PLL_200M>;
		assigned-clock-rates = <0>, <20000000>;
		csi_id = <1>;
		pwn-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
		mclk = <20000000>;
		mclk_source = <0>;
		port {
			ov5640_mipi2_ep: endpoint {
				remote-endpoint = <&mipi2_sensor_ep>;
			};
		};
	};
};