Skip to content

add mira220 image sensor #6717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: rpi-6.12.y
Choose a base branch
from
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
minipitft13.dtbo \
miniuart-bt.dtbo \
mipi-dbi-spi.dtbo \
mira220.dtbo \
mlx90640.dtbo \
mmc.dtbo \
mz61581.dtbo \
Expand Down
15 changes: 15 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -3511,6 +3511,21 @@ Params:
(default 16).


Name: mira220
Info: ams mira220 camera module.
Uses Unicam 1, which is the standard camera connector on most Pi
variants.
Load: dtoverlay=mira220,<param>=<val>
Params: rotation Mounting rotation of the camera sensor (0 or
180, default 0)
orientation Sensor orientation (0 = front, 1 = rear,
2 = external, default external)
media-controller Configure use of Media Controller API for
configuring the sensor (default on)
cam0 Adopt the default configuration for CAM0 on a
Compute Module (CSI0, i2c_vc, and cam0_reg).


Name: mlx90640
Info: Overlay for i2c connected mlx90640 thermal camera
Load: dtoverlay=mlx90640
Expand Down
87 changes: 87 additions & 0 deletions arch/arm/boot/dts/overlays/mira220-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// SPDX-License-Identifier: GPL-2.0-only
// Definitions for MIRA220 camera module on VC I2C bus
/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>

/{
compatible = "brcm,bcm2835";

fragment@0 {
target = <&i2c0if>;
__overlay__ {
status = "okay";
};
};

clk_frag: fragment@1 {
target = <&cam1_clk>;
__overlay__ {
status = "okay";
clock-frequency = <38400000>;
};
};

fragment@2 {
target = <&i2c0mux>;
__overlay__ {
status = "okay";
};
};

i2c_frag: fragment@100 {
target = <&i2c_csi_dsi>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

#include "mira220.dtsi"

};
};

csi_frag: fragment@101 {
target = <&csi1>;
csi: __overlay__ {
status = "okay";

port {
csi_ep: endpoint {
remote-endpoint = <&cam_endpoint>;
clock-lanes = <0>;
data-lanes = <1 2>;
// clock-noncontinuous; // mira220 use cont clk
};
};
};
};

fragment@102 {
target = <&csi1>;
__dormant__ {
compatible = "brcm,bcm2835-unicam-legacy";
};
};


__overrides__ {
rotation = <&cam_node>,"rotation:0";
orientation = <&cam_node>,"orientation:0";
media-controller = <0>,"!102";
cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
<&csi_frag>, "target:0=",<&csi0>,
<&clk_frag>, "target:0=",<&cam0_clk>,
<&cam_node>, "clocks:0=",<&cam0_clk>,
<&cam_node>, "vana-supply:0=",<&cam0_reg>;
};
};

&cam_node {
status = "okay";
};

&cam_endpoint {
remote-endpoint = <&csi_ep>;
};
27 changes: 27 additions & 0 deletions arch/arm/boot/dts/overlays/mira220.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Fragment that configures an mira220

cam_node: mira220@10 {
compatible = "ams,mira220";
reg = <0x54>;
status = "disabled";

clocks = <&cam1_clk>;
clock-names = "xclk";

vana-supply = <&cam1_reg>; /* 2.8v */
vdig-supply = <&cam_dummy_reg>; /* 1.8v */
vddl-supply = <&cam_dummy_reg>; /* 1.2v */

rotation = <0>;
orientation = <2>;

port {
cam_endpoint: endpoint {
clock-lanes = <0>;
data-lanes = <1 2>;
// clock-noncontinuous;
link-frequencies =
/bits/ 64 <750000000>;
};
};
};
1 change: 1 addition & 0 deletions arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_IMX500=m
CONFIG_VIDEO_IMX519=m
CONFIG_VIDEO_IMX708=m
CONFIG_VIDEO_MIRA220=m
CONFIG_VIDEO_MT9V011=m
CONFIG_VIDEO_OV2311=m
CONFIG_VIDEO_OV5647=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_IMX500=m
CONFIG_VIDEO_IMX519=m
CONFIG_VIDEO_IMX708=m
CONFIG_VIDEO_MIRA220=m
CONFIG_VIDEO_MT9V011=m
CONFIG_VIDEO_OV2311=m
CONFIG_VIDEO_OV5647=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_IMX500=m
CONFIG_VIDEO_IMX519=m
CONFIG_VIDEO_IMX708=m
CONFIG_VIDEO_MIRA220=m
CONFIG_VIDEO_MT9V011=m
CONFIG_VIDEO_OV2311=m
CONFIG_VIDEO_OV5647=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,7 @@ CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_IMX500=m
CONFIG_VIDEO_IMX519=m
CONFIG_VIDEO_IMX708=m
CONFIG_VIDEO_MIRA220=m
CONFIG_VIDEO_MT9V011=m
CONFIG_VIDEO_OV2311=m
CONFIG_VIDEO_OV5647=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/bcm2711_rt_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,7 @@ CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_IMX500=m
CONFIG_VIDEO_IMX519=m
CONFIG_VIDEO_IMX708=m
CONFIG_VIDEO_MIRA220=m
CONFIG_VIDEO_MT9V011=m
CONFIG_VIDEO_OV2311=m
CONFIG_VIDEO_OV5647=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/bcm2712_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,7 @@ CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_IMX500=m
CONFIG_VIDEO_IMX519=m
CONFIG_VIDEO_IMX708=m
CONFIG_VIDEO_MIRA220=m
CONFIG_VIDEO_MT9V011=m
CONFIG_VIDEO_OV2311=m
CONFIG_VIDEO_OV5647=m
Expand Down
14 changes: 14 additions & 0 deletions drivers/media/i2c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,20 @@ config VIDEO_IMX708
config VIDEO_MAX9271_LIB
tristate

config VIDEO_MIRA220
tristate "ams MIRA220 sensor support"
depends on I2C && VIDEO_DEV
select MEDIA_CONTROLLER
select VIDEO_V4L2_SUBDEV_API
select V4L2_CCI_I2C
select V4L2_FWNODE
help
This is a Video4Linux2 sensor driver for the ams
MIRA220 camera.

To compile this driver as a module, choose M here: the
module will be called mira220.

config VIDEO_MT9M001
tristate "mt9m001 support"
help
Expand Down
1 change: 1 addition & 0 deletions drivers/media/i2c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ obj-$(CONFIG_VIDEO_MAX9271_LIB) += max9271.o
obj-$(CONFIG_VIDEO_MAX9286) += max9286.o
obj-$(CONFIG_VIDEO_MAX96714) += max96714.o
obj-$(CONFIG_VIDEO_MAX96717) += max96717.o
obj-$(CONFIG_VIDEO_MIRA220) += mira220.o
obj-$(CONFIG_VIDEO_ML86V7667) += ml86v7667.o
obj-$(CONFIG_VIDEO_MSP3400) += msp3400.o
obj-$(CONFIG_VIDEO_MT9M001) += mt9m001.o
Expand Down
Loading