c0ba49443800be6462c821d369673689a0918f2b
[openwrt/staging/hauke.git] /
1 From f76b8590a1808ae27ce687b2ab5eedb3cd4b3149 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Fri, 25 Feb 2022 18:16:26 +0000
4 Subject: [PATCH] dtoverlays: Add overlay for Omnivision OV2311 image
5 sensor
6
7 Adds an overlay for the OV2311 1600x1300 monochrome global
8 shutter image sensor.
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 ---
12 arch/arm/boot/dts/overlays/Makefile | 1 +
13 arch/arm/boot/dts/overlays/README | 15 +++
14 arch/arm/boot/dts/overlays/ov2311-overlay.dts | 93 +++++++++++++++++++
15 3 files changed, 109 insertions(+)
16 create mode 100644 arch/arm/boot/dts/overlays/ov2311-overlay.dts
17
18 --- a/arch/arm/boot/dts/overlays/Makefile
19 +++ b/arch/arm/boot/dts/overlays/Makefile
20 @@ -139,6 +139,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
21 mmc.dtbo \
22 mpu6050.dtbo \
23 mz61581.dtbo \
24 + ov2311.dtbo \
25 ov5647.dtbo \
26 ov7251.dtbo \
27 ov9281.dtbo \
28 --- a/arch/arm/boot/dts/overlays/README
29 +++ b/arch/arm/boot/dts/overlays/README
30 @@ -2421,6 +2421,21 @@ Params: speed Display
31 xohms Touchpanel sensitivity (X-plate resistance)
32
33
34 +Name: ov2311
35 +Info: Omnivision OV2311 camera module.
36 + Uses Unicam 1, which is the standard camera connector on most Pi
37 + variants.
38 +Load: dtoverlay=ov2311,<param>=<val>
39 +Params: rotation Mounting rotation of the camera sensor (0 or
40 + 180, default 0)
41 + orientation Sensor orientation (0 = front, 1 = rear,
42 + 2 = external, default external)
43 + media-controller Configure use of Media Controller API for
44 + configuring the sensor (default on)
45 + cam0 Adopt the default configuration for CAM0 on a
46 + Compute Module (CSI0, i2c_vc, and cam0_reg).
47 +
48 +
49 Name: ov5647
50 Info: Omnivision OV5647 camera module.
51 Uses Unicam 1, which is the standard camera connector on most Pi
52 --- /dev/null
53 +++ b/arch/arm/boot/dts/overlays/ov2311-overlay.dts
54 @@ -0,0 +1,93 @@
55 +// SPDX-License-Identifier: GPL-2.0-only
56 +// Definitions for OV2311 camera module on VC I2C bus
57 +/dts-v1/;
58 +/plugin/;
59 +
60 +#include <dt-bindings/gpio/gpio.h>
61 +
62 +/{
63 + compatible = "brcm,bcm2835";
64 +
65 + i2c_frag: fragment@0 {
66 + target = <&i2c_csi_dsi>;
67 + __overlay__ {
68 + #address-cells = <1>;
69 + #size-cells = <0>;
70 + status = "okay";
71 +
72 + ov2311: ov2311@60 {
73 + compatible = "ovti,ov2311";
74 + reg = <0x60>;
75 + status = "okay";
76 +
77 + clocks = <&cam1_clk>;
78 + clock-names = "xvclk";
79 +
80 + avdd-supply = <&cam1_reg>;
81 + dovdd-supply = <&cam_dummy_reg>;
82 + dvdd-supply = <&cam_dummy_reg>;
83 +
84 + rotation = <0>;
85 + orientation = <2>;
86 +
87 + port {
88 + ov2311_0: endpoint {
89 + remote-endpoint = <&csi1_ep>;
90 + clock-lanes = <0>;
91 + data-lanes = <1 2>;
92 + link-frequencies =
93 + /bits/ 64 <400000000>;
94 + };
95 + };
96 + };
97 + };
98 + };
99 +
100 + csi_frag: fragment@1 {
101 + target = <&csi1>;
102 + csi: __overlay__ {
103 + status = "okay";
104 + brcm,media-controller;
105 +
106 + port {
107 + csi1_ep: endpoint {
108 + remote-endpoint = <&ov2311_0>;
109 + data-lanes = <1 2>;
110 + };
111 + };
112 + };
113 + };
114 +
115 + fragment@2 {
116 + target = <&i2c0if>;
117 + __overlay__ {
118 + status = "okay";
119 + };
120 + };
121 +
122 + fragment@3 {
123 + target = <&i2c0mux>;
124 + __overlay__ {
125 + status = "okay";
126 + };
127 + };
128 +
129 + clk_frag: fragment@4 {
130 + target = <&cam1_clk>;
131 + __overlay__ {
132 + status = "okay";
133 + clock-frequency = <24000000>;
134 + };
135 + };
136 +
137 + __overrides__ {
138 + rotation = <&ov2311>,"rotation:0";
139 + orientation = <&ov2311>,"orientation:0";
140 + media-controller = <&csi>,"brcm,media-controller?";
141 + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
142 + <&csi_frag>, "target:0=",<&csi0>,
143 + <&clk_frag>, "target:0=",<&cam0_clk>,
144 + <&ov2311>, "clocks:0=",<&cam0_clk>,
145 + <&ov2311>, "avdd-supply:0=",<&cam0_reg>;
146 + };
147 +};