-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbpi-m3-bpi-camera.dts
135 lines (120 loc) · 3.36 KB
/
bpi-m3-bpi-camera.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
//
// Copyright (C) 2019 Chen-Yu Tsai <wens@csie.org>
//
// Bananapi camera module v3 for BPI-M3 with OV5640 and OV8865
//
// On the BPI-M3, AFVCC-CSI and IOVDD-CSI are directly tied to AVDD-CSI (DLDO4).
// These, and DVDD-CSI (ELDO1) directly feed the OV8655. (R17 is present, while R23 is not.)
//
// The four onboard regulators feed the OV5640. (R17, R18, R19, R20 are not present.)
// These are enabled when AVDD-CSI is on. They are fed by PS.
//
// CSI-MCLK and CSI-RST are shared by both camera sensors.
//
// TODO: OV8865 @ 0x36, VM149C @ 0x0c, ???? @ 0x20
//
// Note: OV8865 shutdown is active-low, unlike OV5640 where it is active-high
#ifdef __DTO_TEST__
#include <arm/sun8i-a83t-bananapi-m3.dts>
#else
/dts-v1/;
/plugin/;
#endif
#include <dt-bindings/clock/sun8i-a83t-ccu.h>
#include <dt-bindings/gpio/gpio.h>
&{/} {
reg_ov5640_avdd: ov5640-avdd {
compatible = "regulator-fixed";
regulator-name = "ov5640-avdd";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
/* dldo4 enables this regulator; real supply is PS */
vin-supply = <®_dldo4>;
};
reg_ov5640_dovdd: ov5640-iovdd {
compatible = "regulator-fixed";
regulator-name = "ov5640-dovdd";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
/* dldo4 enables this regulator; real supply is PS */
vin-supply = <®_dldo4>;
};
reg_ov5640_dvdd: ov5640-dvdd {
compatible = "regulator-fixed";
regulator-name = "ov5640-dvdd";
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <1500000>;
/* dldo4 enables this regulator; real supply is PS */
vin-supply = <®_dldo4>;
};
};
&ccu {
assigned-clocks = <&ccu CLK_CSI_MCLK>;
assigned-clock-parents = <&osc24M>;
assigned-clock-rates = <24000000>;
};
&csi {
pinctrl-names = "default";
pinctrl-0 = <&csi_8bit_parallel_pins>;
status = "okay";
};
&csi_in {
/* Parallel bus endpoint */
csi_from_ov5640: endpoint {
remote-endpoint = <&ov5640_to_csi>;
bus-width = <8>;
data-shift = <2>;
hsync-active = <1>; /* Active high */
vsync-active = <1>; /* Active high */
pclk-sample = <1>; /* Falling */
rotation = <180>;
};
};
&i2c2 {
pinctrl-names = "default";
pinctrl-0 = <&i2c2_pe_pins>;
status = "okay";
ov5640: camera@3c {
compatible = "ovti,ov5640";
reg = <0x3c>;
clocks = <&ccu CLK_CSI_MCLK>;
clock-names = "xclk";
/* reset shared with OV8655 */
reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */
powerdown-gpios = <&pio 3 15 GPIO_ACTIVE_HIGH>; /* PD15 */
AVDD-supply = <®_ov5640_avdd>;
DOVDD-supply = <®_ov5640_dovdd>;
DVDD-supply = <®_ov5640_dvdd>;
port {
ov5640_to_csi: endpoint {
remote-endpoint = <&csi_from_ov5640>;
bus-width = <8>;
data-shift = <2>;
hsync-active = <1>; /* Active high */
vsync-active = <1>; /* Active low */
pclk-sample = <1>; /* Rising */
};
};
};
};
&pio {
pinctrl-names = "default";
pinctrl-0 = <&csi_mclk_pin>;
#if 0
/* This is not the real thing, but dldo4 provides pull-ups for I2C */
vcc-pe-supply = <®_dldo4>;
#endif
};
®_dldo4 {
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
regulator-name = "avdd-csi";
/* This also powers the pull-ups on the CSI connector */
regulator-always-on;
};
®_eldo1 {
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-name = "dvdd-csi-r";
};