-
Notifications
You must be signed in to change notification settings - Fork 0
/
bpi-m2p-ov5640.dts
107 lines (95 loc) · 2.53 KB
/
bpi-m2p-ov5640.dts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
//
// Copyright (C) 2018 Chen-Yu Tsai <[email protected]>
//
// Bananapi camera module based on OV5640
#ifdef __DTO_TEST__
#include <arm/sun8i-h3-bananapi-m2-plus.dts>
#else
/dts-v1/;
/plugin/;
#endif
#include <dt-bindings/clock/sun8i-h3-ccu.h>
#include <dt-bindings/gpio/gpio.h>
&{/} {
reg_cam_avdd: cam-avdd {
compatible = "regulator-fixed";
regulator-name = "csi-avdd";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
startup-delay-us = <200>; /* 50 us + board delays */
enable-active-high;
gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
};
reg_cam_dovdd: cam-dovdd {
compatible = "regulator-fixed";
regulator-name = "csi-dovdd";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
/*
* This regulator also powers the pull-ups for the I2C bus.
* For some reason, if this is turned off, subsequent use
* of the I2C bus, even when turned on, does not work.
*/
startup-delay-us = <200>; /* 50 us + board delays */
regulator-always-on;
enable-active-high;
gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
};
reg_cam_dvdd: cam-dvdd {
compatible = "regulator-fixed";
regulator-name = "csi-dvdd";
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <1500000>;
startup-delay-us = <200>; /* 50 us + board delays */
enable-active-high;
gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
};
};
&csi {
status = "okay";
port {
/* Parallel bus endpoint */
csi_from_ov5640: endpoint {
remote-endpoint = <&ov5640_to_csi>;
bus-width = <8>;
hsync-active = <1>; /* Active high */
vsync-active = <0>; /* Active low */
data-active = <1>; /* Active high */
pclk-sample = <1>; /* Rising */
};
};
};
&i2c2 {
status = "okay";
ov5640: camera@3c {
compatible = "ovti,ov5640";
reg = <0x3c>;
pinctrl-names = "default";
pinctrl-0 = <&csi_mclk_pin>;
clocks = <&ccu CLK_CSI_MCLK>;
clock-names = "xclk";
reset-gpios = <&pio 4 14 GPIO_ACTIVE_LOW>; /* PE14 */
powerdown-gpios = <&pio 4 15 GPIO_ACTIVE_HIGH>; /* PE15 */
AVDD-supply = <®_cam_avdd>;
DOVDD-supply = <®_cam_dovdd>;
DVDD-supply = <®_cam_dvdd>;
port {
ov5640_to_csi: endpoint {
remote-endpoint = <&csi_from_ov5640>;
bus-width = <8>;
data-shift = <2>;
hsync-active = <1>; /* Active high */
vsync-active = <0>; /* Active low */
data-active = <1>; /* Active high */
pclk-sample = <1>; /* Rising */
};
};
};
};
&pio {
csi_mclk_pin: csi-mclk {
pins = "PE1";
function = "csi";
};
};