Skip to content

Commit cbf5fa2

Browse files
committed
dtoverlays: Add overlay for ams Mira220 image sensor
1 parent 3a4bede commit cbf5fa2

File tree

4 files changed

+143
-0
lines changed

4 files changed

+143
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
186186
minipitft13.dtbo \
187187
miniuart-bt.dtbo \
188188
mipi-dbi-spi.dtbo \
189+
mira220.dtbo \
189190
mlx90640.dtbo \
190191
mmc.dtbo \
191192
mz61581.dtbo \

arch/arm/boot/dts/overlays/README

+15
Original file line numberDiff line numberDiff line change
@@ -3511,6 +3511,21 @@ Params:
35113511
(default 16).
35123512

35133513

3514+
Name: mira220
3515+
Info: ams mira220 camera module.
3516+
Uses Unicam 1, which is the standard camera connector on most Pi
3517+
variants.
3518+
Load: dtoverlay=mira220,<param>=<val>
3519+
Params: rotation Mounting rotation of the camera sensor (0 or
3520+
180, default 0)
3521+
orientation Sensor orientation (0 = front, 1 = rear,
3522+
2 = external, default external)
3523+
media-controller Configure use of Media Controller API for
3524+
configuring the sensor (default on)
3525+
cam0 Adopt the default configuration for CAM0 on a
3526+
Compute Module (CSI0, i2c_vc, and cam0_reg).
3527+
3528+
35143529
Name: mlx90640
35153530
Info: Overlay for i2c connected mlx90640 thermal camera
35163531
Load: dtoverlay=mlx90640
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
// Definitions for MIRA220 camera module on VC I2C bus
3+
/dts-v1/;
4+
/plugin/;
5+
6+
#include <dt-bindings/gpio/gpio.h>
7+
8+
/{
9+
compatible = "brcm,bcm2835";
10+
11+
fragment@0 {
12+
target = <&i2c0if>;
13+
__overlay__ {
14+
status = "okay";
15+
};
16+
};
17+
18+
clk_frag: fragment@1 {
19+
target = <&cam1_clk>;
20+
__overlay__ {
21+
status = "okay";
22+
clock-frequency = <38400000>;
23+
};
24+
};
25+
26+
fragment@2 {
27+
target = <&i2c0mux>;
28+
__overlay__ {
29+
status = "okay";
30+
};
31+
};
32+
33+
i2c_frag: fragment@100 {
34+
target = <&i2c_csi_dsi>;
35+
__overlay__ {
36+
#address-cells = <1>;
37+
#size-cells = <0>;
38+
status = "okay";
39+
40+
#include "mira220.dtsi"
41+
42+
};
43+
};
44+
45+
csi_frag: fragment@101 {
46+
target = <&csi1>;
47+
csi: __overlay__ {
48+
status = "okay";
49+
50+
port {
51+
csi_ep: endpoint {
52+
remote-endpoint = <&cam_endpoint>;
53+
clock-lanes = <0>;
54+
data-lanes = <1 2>;
55+
// clock-noncontinuous; // mira220 reg seq use continuous clk
56+
};
57+
};
58+
};
59+
};
60+
61+
fragment@102 {
62+
target = <&csi1>;
63+
__dormant__ {
64+
compatible = "brcm,bcm2835-unicam-legacy";
65+
};
66+
};
67+
68+
69+
__overrides__ {
70+
rotation = <&cam_node>,"rotation:0";
71+
orientation = <&cam_node>,"orientation:0";
72+
media-controller = <0>,"!102";
73+
cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
74+
<&csi_frag>, "target:0=",<&csi0>,
75+
<&clk_frag>, "target:0=",<&cam0_clk>,
76+
<&cam_node>, "clocks:0=",<&cam0_clk>,
77+
<&cam_node>, "VANA-supply:0=",<&cam0_reg>;
78+
};
79+
};
80+
81+
&cam_node {
82+
status = "okay";
83+
};
84+
85+
&cam_endpoint {
86+
remote-endpoint = <&csi_ep>;
87+
};
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
// Definitions for MIRA220 camera module on VC I2C bus
3+
4+
5+
//#include <dt-bindings/gpio/gpio.h>
6+
//#include "mira220_mono_color-overlay.dtsi"
7+
//
8+
//&mira220 {
9+
// compatible = "ams,mira220";
10+
// reg-name = "mira220";
11+
//};
12+
13+
14+
// Fragment that configures an mira220
15+
16+
cam_node: mira220@10 {
17+
compatible = "ams,mira220";
18+
reg = <0x54>;
19+
status = "disabled";
20+
21+
clocks = <&cam1_clk>;
22+
clock-names = "xclk";
23+
24+
vana-supply = <&cam1_reg>; /* 2.8v */
25+
vdig-supply = <&cam_dummy_reg>; /* 1.8v */
26+
vddl-supply = <&cam_dummy_reg>; /* 1.2v */
27+
28+
rotation = <0>;
29+
orientation = <2>;
30+
31+
port {
32+
cam_endpoint: endpoint {
33+
clock-lanes = <0>;
34+
data-lanes = <1 2>;
35+
// clock-noncontinuous;
36+
link-frequencies =
37+
/bits/ 64 <750000000>;
38+
};
39+
};
40+
};

0 commit comments

Comments
 (0)