xref: /linux/Documentation/devicetree/bindings/media/i2c/ovti,ov5642.yaml (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1*3a5c419fSFabio Estevam# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2*3a5c419fSFabio Estevam%YAML 1.2
3*3a5c419fSFabio Estevam---
4*3a5c419fSFabio Estevam$id: http://devicetree.org/schemas/media/i2c/ovti,ov5642.yaml#
5*3a5c419fSFabio Estevam$schema: http://devicetree.org/meta-schemas/core.yaml#
6*3a5c419fSFabio Estevam
7*3a5c419fSFabio Estevamtitle: OmniVision OV5642 Image Sensor
8*3a5c419fSFabio Estevam
9*3a5c419fSFabio Estevammaintainers:
10*3a5c419fSFabio Estevam  - Fabio Estevam <festevam@gmail.com>
11*3a5c419fSFabio Estevam
12*3a5c419fSFabio EstevamallOf:
13*3a5c419fSFabio Estevam  - $ref: /schemas/media/video-interface-devices.yaml#
14*3a5c419fSFabio Estevam
15*3a5c419fSFabio Estevamproperties:
16*3a5c419fSFabio Estevam  compatible:
17*3a5c419fSFabio Estevam    const: ovti,ov5642
18*3a5c419fSFabio Estevam
19*3a5c419fSFabio Estevam  reg:
20*3a5c419fSFabio Estevam    maxItems: 1
21*3a5c419fSFabio Estevam
22*3a5c419fSFabio Estevam  clocks:
23*3a5c419fSFabio Estevam    description: XCLK Input Clock
24*3a5c419fSFabio Estevam
25*3a5c419fSFabio Estevam  AVDD-supply:
26*3a5c419fSFabio Estevam    description: Analog voltage supply, 2.8V.
27*3a5c419fSFabio Estevam
28*3a5c419fSFabio Estevam  DVDD-supply:
29*3a5c419fSFabio Estevam    description: Digital core voltage supply, 1.5V.
30*3a5c419fSFabio Estevam
31*3a5c419fSFabio Estevam  DOVDD-supply:
32*3a5c419fSFabio Estevam    description: Digital I/O voltage supply, 1.8V.
33*3a5c419fSFabio Estevam
34*3a5c419fSFabio Estevam  powerdown-gpios:
35*3a5c419fSFabio Estevam    maxItems: 1
36*3a5c419fSFabio Estevam    description: Reference to the GPIO connected to the powerdown pin, if any.
37*3a5c419fSFabio Estevam
38*3a5c419fSFabio Estevam  reset-gpios:
39*3a5c419fSFabio Estevam    maxItems: 1
40*3a5c419fSFabio Estevam    description: Reference to the GPIO connected to the reset pin, if any.
41*3a5c419fSFabio Estevam
42*3a5c419fSFabio Estevam  port:
43*3a5c419fSFabio Estevam    $ref: /schemas/graph.yaml#/$defs/port-base
44*3a5c419fSFabio Estevam    description: |
45*3a5c419fSFabio Estevam      Video output port.
46*3a5c419fSFabio Estevam
47*3a5c419fSFabio Estevam    properties:
48*3a5c419fSFabio Estevam      endpoint:
49*3a5c419fSFabio Estevam        $ref: /schemas/media/video-interfaces.yaml#
50*3a5c419fSFabio Estevam        unevaluatedProperties: false
51*3a5c419fSFabio Estevam
52*3a5c419fSFabio Estevam        properties:
53*3a5c419fSFabio Estevam          bus-type:
54*3a5c419fSFabio Estevam            enum: [5, 6]
55*3a5c419fSFabio Estevam
56*3a5c419fSFabio Estevam          bus-width:
57*3a5c419fSFabio Estevam            enum: [8, 10]
58*3a5c419fSFabio Estevam            default: 10
59*3a5c419fSFabio Estevam
60*3a5c419fSFabio Estevam          data-shift:
61*3a5c419fSFabio Estevam            enum: [0, 2]
62*3a5c419fSFabio Estevam            default: 0
63*3a5c419fSFabio Estevam
64*3a5c419fSFabio Estevam          hsync-active:
65*3a5c419fSFabio Estevam            enum: [0, 1]
66*3a5c419fSFabio Estevam            default: 1
67*3a5c419fSFabio Estevam
68*3a5c419fSFabio Estevam          vsync-active:
69*3a5c419fSFabio Estevam            enum: [0, 1]
70*3a5c419fSFabio Estevam            default: 1
71*3a5c419fSFabio Estevam
72*3a5c419fSFabio Estevam          pclk-sample:
73*3a5c419fSFabio Estevam            enum: [0, 1]
74*3a5c419fSFabio Estevam            default: 1
75*3a5c419fSFabio Estevam
76*3a5c419fSFabio Estevam        allOf:
77*3a5c419fSFabio Estevam          - if:
78*3a5c419fSFabio Estevam              properties:
79*3a5c419fSFabio Estevam                bus-type:
80*3a5c419fSFabio Estevam                  const: 6
81*3a5c419fSFabio Estevam            then:
82*3a5c419fSFabio Estevam              properties:
83*3a5c419fSFabio Estevam                hsync-active: false
84*3a5c419fSFabio Estevam                vsync-active: false
85*3a5c419fSFabio Estevam
86*3a5c419fSFabio Estevam          - if:
87*3a5c419fSFabio Estevam              properties:
88*3a5c419fSFabio Estevam                bus-width:
89*3a5c419fSFabio Estevam                  const: 10
90*3a5c419fSFabio Estevam            then:
91*3a5c419fSFabio Estevam              properties:
92*3a5c419fSFabio Estevam                data-shift:
93*3a5c419fSFabio Estevam                  const: 0
94*3a5c419fSFabio Estevam
95*3a5c419fSFabio Estevam        required:
96*3a5c419fSFabio Estevam          - bus-type
97*3a5c419fSFabio Estevam
98*3a5c419fSFabio Estevam    additionalProperties: false
99*3a5c419fSFabio Estevam
100*3a5c419fSFabio Estevamrequired:
101*3a5c419fSFabio Estevam  - compatible
102*3a5c419fSFabio Estevam  - reg
103*3a5c419fSFabio Estevam  - clocks
104*3a5c419fSFabio Estevam  - port
105*3a5c419fSFabio Estevam
106*3a5c419fSFabio EstevamadditionalProperties: false
107*3a5c419fSFabio Estevam
108*3a5c419fSFabio Estevamexamples:
109*3a5c419fSFabio Estevam  - |
110*3a5c419fSFabio Estevam      #include <dt-bindings/gpio/gpio.h>
111*3a5c419fSFabio Estevam      #include <dt-bindings/media/video-interfaces.h>
112*3a5c419fSFabio Estevam
113*3a5c419fSFabio Estevam      i2c {
114*3a5c419fSFabio Estevam          #address-cells = <1>;
115*3a5c419fSFabio Estevam          #size-cells = <0>;
116*3a5c419fSFabio Estevam
117*3a5c419fSFabio Estevam          camera@3c {
118*3a5c419fSFabio Estevam              compatible = "ovti,ov5642";
119*3a5c419fSFabio Estevam              reg = <0x3c>;
120*3a5c419fSFabio Estevam              pinctrl-names = "default";
121*3a5c419fSFabio Estevam              pinctrl-0 = <&pinctrl_ov5642>;
122*3a5c419fSFabio Estevam              clocks = <&clk_ext_camera>;
123*3a5c419fSFabio Estevam              DOVDD-supply = <&vgen4_reg>;
124*3a5c419fSFabio Estevam              AVDD-supply = <&vgen3_reg>;
125*3a5c419fSFabio Estevam              DVDD-supply = <&vgen2_reg>;
126*3a5c419fSFabio Estevam              powerdown-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
127*3a5c419fSFabio Estevam              reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
128*3a5c419fSFabio Estevam
129*3a5c419fSFabio Estevam              port {
130*3a5c419fSFabio Estevam                  ov5642_to_parallel: endpoint {
131*3a5c419fSFabio Estevam                      bus-type = <MEDIA_BUS_TYPE_PARALLEL>;
132*3a5c419fSFabio Estevam                      remote-endpoint = <&parallel_from_ov5642>;
133*3a5c419fSFabio Estevam                      bus-width = <8>;
134*3a5c419fSFabio Estevam                      data-shift = <2>; /* lines 9:2 are used */
135*3a5c419fSFabio Estevam                      hsync-active = <0>;
136*3a5c419fSFabio Estevam                      vsync-active = <0>;
137*3a5c419fSFabio Estevam                      pclk-sample = <1>;
138*3a5c419fSFabio Estevam                  };
139*3a5c419fSFabio Estevam              };
140*3a5c419fSFabio Estevam          };
141*3a5c419fSFabio Estevam      };
142