1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/media/i2c/ovti,ov5640.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: OmniVision OV5640 Image Sensor Device Tree Bindings
8
9maintainers:
10  - Steve Longerbeam <slongerbeam@gmail.com>
11
12allOf:
13  - $ref: /schemas/media/video-interface-devices.yaml#
14
15properties:
16  compatible:
17    const: ovti,ov5640
18
19  reg:
20    maxItems: 1
21
22  clocks:
23    description: XCLK Input Clock
24
25  clock-names:
26    const: xclk
27
28  AVDD-supply:
29    description: Analog voltage supply, 2.8 volts
30
31  DVDD-supply:
32    description: Digital core voltage supply, 1.5 volts
33
34  DOVDD-supply:
35    description: Digital I/O voltage supply, 1.8 volts
36
37  powerdown-gpios:
38    maxItems: 1
39    description: >
40      Reference to the GPIO connected to the powerdown pin, if any.
41
42  reset-gpios:
43    maxItems: 1
44    description: >
45      Reference to the GPIO connected to the reset pin, if any.
46
47  rotation:
48    enum:
49      - 0
50      - 180
51
52  port:
53    description: Digital Output Port
54    $ref: /schemas/graph.yaml#/$defs/port-base
55    additionalProperties: false
56
57    properties:
58      endpoint:
59        $ref: /schemas/media/video-interfaces.yaml#
60        unevaluatedProperties: false
61
62        properties:
63          clock-lanes:
64            const: 0
65
66          data-lanes:
67            minItems: 1
68            maxItems: 2
69            items:
70              enum: [1, 2]
71
72          bus-width:
73            enum: [8, 10]
74
75          data-shift:
76            enum: [0, 2]
77
78required:
79  - compatible
80  - reg
81  - clocks
82  - clock-names
83  - AVDD-supply
84  - DVDD-supply
85  - DOVDD-supply
86  - port
87
88additionalProperties: false
89
90examples:
91  - |
92      #include <dt-bindings/clock/imx6qdl-clock.h>
93      #include <dt-bindings/gpio/gpio.h>
94
95      i2c {
96          #address-cells = <1>;
97          #size-cells = <0>;
98
99          camera@3c {
100              compatible = "ovti,ov5640";
101              pinctrl-names = "default";
102              pinctrl-0 = <&pinctrl_ov5640>;
103              reg = <0x3c>;
104              clocks = <&clks IMX6QDL_CLK_CKO>;
105              clock-names = "xclk";
106              DOVDD-supply = <&vgen4_reg>; /* 1.8v */
107              AVDD-supply = <&vgen3_reg>;  /* 2.8v */
108              DVDD-supply = <&vgen2_reg>;  /* 1.5v */
109              powerdown-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
110              reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
111              rotation = <180>;
112
113              port {
114                  /* MIPI CSI-2 bus endpoint */
115                  ov5640_to_mipi_csi2: endpoint {
116                      remote-endpoint = <&mipi_csi2_from_ov5640>;
117                      clock-lanes = <0>;
118                      data-lanes = <1 2>;
119                  };
120              };
121          };
122      };
123
124  - |
125      i2c {
126          #address-cells = <1>;
127          #size-cells = <0>;
128
129          camera@3c {
130              compatible = "ovti,ov5640";
131              pinctrl-names = "default";
132              pinctrl-0 = <&pinctrl_ov5640>;
133              reg = <0x3c>;
134              clocks = <&clk_ext_camera>;
135              clock-names = "xclk";
136              DOVDD-supply = <&vgen4_reg>; /* 1.8v */
137              AVDD-supply = <&vgen3_reg>;  /* 2.8v */
138              DVDD-supply = <&vgen2_reg>;  /* 1.5v */
139
140              port {
141                  /* Parallel bus endpoint */
142                  ov5640_to_parallel: endpoint {
143                      remote-endpoint = <&parallel_from_ov5640>;
144                      bus-width = <8>;
145                      data-shift = <2>; /* lines 9:2 are used */
146                      hsync-active = <0>;
147                      vsync-active = <0>;
148                      pclk-sample = <1>;
149                  };
150              };
151          };
152      };
153
154...
155