Skip to content

Commit 02b40b6

Browse files
committed
add ams mira220 driver and device tree
1 parent 9e61a31 commit 02b40b6

File tree

11 files changed

+4528
-0
lines changed

11 files changed

+4528
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
132132
i2s-gpio28-31.dtbo \
133133
i2s-master-dac.dtbo \
134134
ilitek251x.dtbo \
135+
mira220.dtbo \
135136
imx219.dtbo \
136137
imx258.dtbo \
137138
imx290.dtbo \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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 = <24000000>;
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 continous clk
56+
};
57+
};
58+
};
59+
};
60+
61+
fragment@102 {
62+
target = <&csi1>;
63+
__dormant__ {
64+
compatible = "brcm,bcm2835-unicam-legacy";
65+
};
66+
};
67+
68+
fragment@201 {
69+
target = <&csi_ep>;
70+
__dormant__ {
71+
data-lanes = <1 2 >;
72+
};
73+
};
74+
75+
fragment@202 {
76+
target = <&cam_endpoint>;
77+
__dormant__ {
78+
data-lanes = <1 2 >;
79+
link-frequencies =
80+
/bits/ 64 <363000000>;
81+
};
82+
};
83+
84+
__overrides__ {
85+
rotation = <&cam_node>,"rotation:0";
86+
orientation = <&cam_node>,"orientation:0";
87+
media-controller = <0>,"!102";
88+
cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
89+
<&csi_frag>, "target:0=",<&csi0>,
90+
<&clk_frag>, "target:0=",<&cam0_clk>,
91+
<&cam_node>, "clocks:0=",<&cam0_clk>,
92+
<&cam_node>, "VANA-supply:0=",<&cam0_reg>;
93+
};
94+
};
95+
96+
&cam_node {
97+
status = "okay";
98+
};
99+
100+
&cam_endpoint {
101+
remote-endpoint = <&csi_ep>;
102+
};
+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 <456000000>;
38+
};
39+
};
40+
};

arch/arm/configs/bcm2709_defconfig

+1
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,7 @@ CONFIG_VIDEO_BCM2835_UNICAM_LEGACY=m
934934
CONFIG_VIDEO_BCM2835_UNICAM=m
935935
CONFIG_VIDEO_ARDUCAM_64MP=m
936936
CONFIG_VIDEO_ARDUCAM_PIVARIETY=m
937+
CONFIG_VIDEO_MIRA220=m
937938
CONFIG_VIDEO_IMX219=m
938939
CONFIG_VIDEO_IMX258=m
939940
CONFIG_VIDEO_IMX290=m

arch/arm/configs/bcm2711_defconfig

+1
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,7 @@ CONFIG_VIDEO_BCM2835_UNICAM=m
963963
CONFIG_VIDEO_RPI_HEVC_DEC=m
964964
CONFIG_VIDEO_ARDUCAM_64MP=m
965965
CONFIG_VIDEO_ARDUCAM_PIVARIETY=m
966+
CONFIG_VIDEO_MIRA220=m
966967
CONFIG_VIDEO_IMX219=m
967968
CONFIG_VIDEO_IMX258=m
968969
CONFIG_VIDEO_IMX290=m

arch/arm/configs/bcmrpi_defconfig

+1
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@ CONFIG_VIDEO_BCM2835_UNICAM_LEGACY=m
927927
CONFIG_VIDEO_BCM2835_UNICAM=m
928928
CONFIG_VIDEO_ARDUCAM_64MP=m
929929
CONFIG_VIDEO_ARDUCAM_PIVARIETY=m
930+
CONFIG_VIDEO_MIRA220=m
930931
CONFIG_VIDEO_IMX219=m
931932
CONFIG_VIDEO_IMX258=m
932933
CONFIG_VIDEO_IMX290=m

arch/arm64/configs/bcm2711_defconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,7 @@ CONFIG_VIDEO_VIMC=m
10121012
CONFIG_VIDEO_VIVID=m
10131013
CONFIG_VIDEO_ARDUCAM_64MP=m
10141014
CONFIG_VIDEO_ARDUCAM_PIVARIETY=m
1015+
CONFIG_VIDEO_MIRA220=m
10151016
CONFIG_VIDEO_IMX219=m
10161017
CONFIG_VIDEO_IMX258=m
10171018
CONFIG_VIDEO_IMX290=m

arch/arm64/configs/bcm2712_defconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,7 @@ CONFIG_VIDEO_VIMC=m
10141014
CONFIG_VIDEO_VIVID=m
10151015
CONFIG_VIDEO_ARDUCAM_64MP=m
10161016
CONFIG_VIDEO_ARDUCAM_PIVARIETY=m
1017+
CONFIG_VIDEO_MIRA220=m
10171018
CONFIG_VIDEO_IMX219=m
10181019
CONFIG_VIDEO_IMX258=m
10191020
CONFIG_VIDEO_IMX290=m

drivers/media/i2c/Kconfig

+13
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,19 @@ config VIDEO_HI847
149149
To compile this driver as a module, choose M here: the
150150
module will be called hi847.
151151

152+
config VIDEO_MIRA220
153+
tristate "ams MIRA220 sensor support"
154+
depends on I2C && VIDEO_DEV
155+
select MEDIA_CONTROLLER
156+
select VIDEO_V4L2_SUBDEV_API
157+
select V4L2_FWNODE
158+
help
159+
This is a Video4Linux2 sensor driver for the ams
160+
MIRA220 camera.
161+
162+
To compile this driver as a module, choose M here: the
163+
module will be called mira220.
164+
152165
config VIDEO_IMX208
153166
tristate "Sony IMX208 sensor support"
154167
help

drivers/media/i2c/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ obj-$(CONFIG_VIDEO_HI556) += hi556.o
4949
obj-$(CONFIG_VIDEO_HI846) += hi846.o
5050
obj-$(CONFIG_VIDEO_HI847) += hi847.o
5151
obj-$(CONFIG_VIDEO_I2C) += video-i2c.o
52+
obj-$(CONFIG_VIDEO_MIRA220) += mira220.o
5253
obj-$(CONFIG_VIDEO_IMX208) += imx208.o
5354
obj-$(CONFIG_VIDEO_IMX214) += imx214.o
5455
obj-$(CONFIG_VIDEO_IMX219) += imx219.o

0 commit comments

Comments
 (0)