6a4da8f814d7e4a9b69c279dbd145cc7650fa5c7
[openwrt/openwrt.git] /
1 From 870de3bc0e80a9b79b470a45636437a0078041c1 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 7 Jul 2020 16:12:05 +0100
4 Subject: [PATCH] dtoverlays: Create an overlay for the Omnivision
5 OV7251 sensor
6
7 Adds an overlay for the OV7251 VGA global shutter sensor.
8
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
10 ---
11 arch/arm/boot/dts/overlays/Makefile | 1 +
12 arch/arm/boot/dts/overlays/README | 8 ++
13 arch/arm/boot/dts/overlays/ov7251-overlay.dts | 111 ++++++++++++++++++
14 3 files changed, 120 insertions(+)
15 create mode 100644 arch/arm/boot/dts/overlays/ov7251-overlay.dts
16
17 --- a/arch/arm/boot/dts/overlays/Makefile
18 +++ b/arch/arm/boot/dts/overlays/Makefile
19 @@ -115,6 +115,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
20 mpu6050.dtbo \
21 mz61581.dtbo \
22 ov5647.dtbo \
23 + ov7251.dtbo \
24 ov9281.dtbo \
25 papirus.dtbo \
26 pibell.dtbo \
27 --- a/arch/arm/boot/dts/overlays/README
28 +++ b/arch/arm/boot/dts/overlays/README
29 @@ -1813,6 +1813,14 @@ Load: dtoverlay=ov5647
30 Params: <None>
31
32
33 +Name: ov7251
34 +Info: Omnivision OV7251 camera module.
35 + Uses Unicam 1, which is the standard camera connector on most Pi
36 + variants.
37 +Load: dtoverlay=ov7251
38 +Params: <None>
39 +
40 +
41 Name: ov9281
42 Info: Omnivision OV9281 camera module.
43 Uses Unicam 1, which is the standard camera connector on most Pi
44 --- /dev/null
45 +++ b/arch/arm/boot/dts/overlays/ov7251-overlay.dts
46 @@ -0,0 +1,111 @@
47 +// SPDX-License-Identifier: GPL-2.0-only
48 +// Definitions for OV7251 camera module on VC I2C bus
49 +/dts-v1/;
50 +/plugin/;
51 +
52 +#include <dt-bindings/gpio/gpio.h>
53 +
54 +/{
55 + compatible = "brcm,bcm2835";
56 +
57 + fragment@0 {
58 + target = <&i2c_csi_dsi>;
59 + __overlay__ {
60 + #address-cells = <1>;
61 + #size-cells = <0>;
62 + status = "okay";
63 +
64 + ov7251: ov7251@60 {
65 + compatible = "ovti,ov7251";
66 + reg = <0x60>;
67 + status = "okay";
68 +
69 + clocks = <&ov7251_clk>;
70 + clock-names = "xclk";
71 + clock-frequency = <24000000>;
72 +
73 + vdddo-supply = <&ov7251_dovdd>;
74 + vdda-supply = <&ov7251_avdd>;
75 + vddd-supply = <&ov7251_dvdd>;
76 +
77 + enable-gpios = <&gpio 41 GPIO_ACTIVE_HIGH>;
78 +
79 + port {
80 + ov7251_0: endpoint {
81 + remote-endpoint = <&csi1_ep>;
82 + clock-lanes = <0>;
83 + data-lanes = <1>;
84 + clock-noncontinuous;
85 + link-frequencies =
86 + /bits/ 64 <456000000>;
87 + };
88 + };
89 + };
90 + };
91 + };
92 +
93 + fragment@1 {
94 + target = <&csi1>;
95 + __overlay__ {
96 + status = "okay";
97 +
98 + port {
99 + csi1_ep: endpoint {
100 + remote-endpoint = <&ov7251_0>;
101 + data-lanes = <1>;
102 + };
103 + };
104 + };
105 + };
106 +
107 + fragment@2 {
108 + target = <&i2c0if>;
109 + __overlay__ {
110 + status = "okay";
111 + };
112 + };
113 +
114 + fragment@3 {
115 + target-path="/";
116 + __overlay__ {
117 + ov7251_avdd: fixedregulator@0 {
118 + compatible = "regulator-fixed";
119 + regulator-name = "ov7251_avdd";
120 + regulator-min-microvolt = <2800000>;
121 + regulator-max-microvolt = <2800000>;
122 + };
123 + ov7251_dovdd: fixedregulator@1 {
124 + compatible = "regulator-fixed";
125 + regulator-name = "ov7251_dovdd";
126 + regulator-min-microvolt = <1800000>;
127 + regulator-max-microvolt = <1800000>;
128 + };
129 + ov7251_dvdd: fixedregulator@2 {
130 + compatible = "regulator-fixed";
131 + regulator-name = "ov7251_dvdd";
132 + regulator-min-microvolt = <1200000>;
133 + regulator-max-microvolt = <1200000>;
134 + };
135 + ov7251_clk: ov7251-clk {
136 + compatible = "fixed-clock";
137 + #clock-cells = <0>;
138 + clock-frequency = <24000000>;
139 + };
140 + };
141 + };
142 +
143 + fragment@4 {
144 + target = <&i2c0mux>;
145 + __overlay__ {
146 + status = "okay";
147 + };
148 + };
149 +
150 + fragment@5 {
151 + target-path="/__overrides__";
152 + __overlay__ {
153 + cam0-pwdn-ctrl = <&ov7251>,"enable-gpios:0";
154 + cam0-pwdn = <&ov7251>,"enable-gpios:4";
155 + };
156 + };
157 +};