xref: /freebsd/sys/contrib/device-tree/Bindings/media/i2c/ov5640.txt (revision a03411e84728e9b267056fd31c7d1d9d1dc1b01e)
1* Omnivision OV5640 MIPI CSI-2 / parallel sensor
2
3Required Properties:
4- compatible: should be "ovti,ov5640"
5- clocks: reference to the xclk input clock.
6- clock-names: should be "xclk".
7- DOVDD-supply: Digital I/O voltage supply, 1.8 volts
8- AVDD-supply: Analog voltage supply, 2.8 volts
9- DVDD-supply: Digital core voltage supply, 1.5 volts
10
11Optional Properties:
12- reset-gpios: reference to the GPIO connected to the reset pin, if any.
13	       This is an active low signal to the OV5640.
14- powerdown-gpios: reference to the GPIO connected to the powerdown pin,
15		   if any. This is an active high signal to the OV5640.
16- rotation: as defined in
17	    Documentation/devicetree/bindings/media/video-interfaces.txt,
18	    valid values are 0 (sensor mounted upright) and 180 (sensor
19	    mounted upside down).
20
21The device node must contain one 'port' child node for its digital output
22video port, in accordance with the video interface bindings defined in
23Documentation/devicetree/bindings/media/video-interfaces.txt.
24
25OV5640 can be connected to a MIPI CSI-2 bus or a parallel bus endpoint.
26
27Endpoint node required properties for CSI-2 connection are:
28- remote-endpoint: a phandle to the bus receiver's endpoint node.
29- clock-lanes: should be set to <0> (clock lane on hardware lane 0)
30- data-lanes: should be set to <1> or <1 2> (one or two CSI-2 lanes supported)
31
32Endpoint node required properties for parallel connection are:
33- remote-endpoint: a phandle to the bus receiver's endpoint node.
34- bus-width: shall be set to <8> for 8 bits parallel bus
35	     or <10> for 10 bits parallel bus
36- data-shift: shall be set to <2> for 8 bits parallel bus
37	      (lines 9:2 are used) or <0> for 10 bits parallel bus
38- hsync-active: active state of the HSYNC signal, 0/1 for LOW/HIGH respectively.
39- vsync-active: active state of the VSYNC signal, 0/1 for LOW/HIGH respectively.
40- pclk-sample: sample data on rising (1) or falling (0) edge of the pixel clock
41	       signal.
42
43Examples:
44
45&i2c1 {
46	ov5640: camera@3c {
47		compatible = "ovti,ov5640";
48		pinctrl-names = "default";
49		pinctrl-0 = <&pinctrl_ov5640>;
50		reg = <0x3c>;
51		clocks = <&clks IMX6QDL_CLK_CKO>;
52		clock-names = "xclk";
53		DOVDD-supply = <&vgen4_reg>; /* 1.8v */
54		AVDD-supply = <&vgen3_reg>;  /* 2.8v */
55		DVDD-supply = <&vgen2_reg>;  /* 1.5v */
56		powerdown-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
57		reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
58		rotation = <180>;
59
60		port {
61			/* MIPI CSI-2 bus endpoint */
62			ov5640_to_mipi_csi2: endpoint {
63				remote-endpoint = <&mipi_csi2_from_ov5640>;
64				clock-lanes = <0>;
65				data-lanes = <1 2>;
66			};
67		};
68	};
69};
70
71&i2c1 {
72	ov5640: camera@3c {
73		compatible = "ovti,ov5640";
74		pinctrl-names = "default";
75		pinctrl-0 = <&pinctrl_ov5640>;
76		reg = <0x3c>;
77		clocks = <&clk_ext_camera>;
78		clock-names = "xclk";
79
80		port {
81			/* Parallel bus endpoint */
82			ov5640_to_parallel: endpoint {
83				remote-endpoint = <&parallel_from_ov5640>;
84				bus-width = <8>;
85				data-shift = <2>; /* lines 9:2 are used */
86				hsync-active = <0>;
87				vsync-active = <0>;
88				pclk-sample = <1>;
89			};
90		};
91	};
92};
93