diff mbox series

arm64: dts: imx8mm-evk: Add camera support

Message ID 20230714030809.1538069-1-festevam@gmail.com (mailing list archive)
State New, archived
Headers show
Series arm64: dts: imx8mm-evk: Add camera support | expand

Commit Message

Fabio Estevam July 14, 2023, 3:08 a.m. UTC
From: Fabio Estevam <festevam@denx.de>

Add support for the OV5640 camera.

Tested with the following commands:

media-ctl -l "'ov5640 2-003c':0 -> 'csis-32e30000.mipi-csi':0 [1]"
media-ctl -V "'ov5640 2-003c':0 [fmt:UYVY8_1X16/640x480 field:none]"
media-ctl -V "'csis-32e30000.mipi-csi':0 [fmt:UYVY8_1X16/640x480 field:none]"
media-ctl -V "'csi':0 [fmt:UYVY8_1X16/640x480 field:none]";
v4l2-ctl --stream-mmap -d /dev/video0

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)

Comments

Shawn Guo July 19, 2023, 6:49 a.m. UTC | #1
On Fri, Jul 14, 2023 at 12:08:09AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> Add support for the OV5640 camera.
> 
> Tested with the following commands:
> 
> media-ctl -l "'ov5640 2-003c':0 -> 'csis-32e30000.mipi-csi':0 [1]"
> media-ctl -V "'ov5640 2-003c':0 [fmt:UYVY8_1X16/640x480 field:none]"
> media-ctl -V "'csis-32e30000.mipi-csi':0 [fmt:UYVY8_1X16/640x480 field:none]"
> media-ctl -V "'csi':0 [fmt:UYVY8_1X16/640x480 field:none]";
> v4l2-ctl --stream-mmap -d /dev/video0
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>

Applied, thanks!
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
index df8e808ac473..e31ab8b4f54f 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
@@ -380,6 +380,11 @@  typec1_con: connector {
 	};
 };
 
+
+&csi {
+	status = "okay";
+};
+
 &i2c3 {
 	clock-frequency = <400000>;
 	pinctrl-names = "default";
@@ -393,12 +398,47 @@  pca6416: gpio@20 {
 		#gpio-cells = <2>;
 		vcc-supply = <&buck4_reg>;
 	};
+
+	camera@3c {
+		compatible = "ovti,ov5640";
+		reg = <0x3c>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_camera>;
+		clocks = <&clk IMX8MM_CLK_CLKO1>;
+		clock-names = "xclk";
+		assigned-clocks = <&clk IMX8MM_CLK_CLKO1>;
+		assigned-clock-parents = <&clk IMX8MM_CLK_24M>;
+		assigned-clock-rates = <24000000>;
+		powerdown-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
+		reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
+
+		port {
+			ov5640_to_mipi_csi2: endpoint {
+				remote-endpoint = <&imx8mm_mipi_csi_in>;
+				clock-lanes = <0>;
+				data-lanes = <1 2>;
+			};
+		};
+	};
 };
 
 &lcdif {
 	status = "okay";
 };
 
+&mipi_csi {
+	status = "okay";
+
+	ports {
+		port@0 {
+			imx8mm_mipi_csi_in: endpoint {
+				remote-endpoint = <&ov5640_to_mipi_csi2>;
+				data-lanes = <1 2>;
+			};
+		};
+	};
+};
+
 &mipi_dsi {
 	samsung,esc-clock-frequency = <10000000>;
 	status = "okay";
@@ -684,4 +724,12 @@  pinctrl_backlight: backlightgrp {
 			MX8MM_IOMUXC_GPIO1_IO01_PWM1_OUT	0x06
 		>;
 	};
+
+	pinctrl_camera: cameragrp {
+		fsl,pins = <
+			MX8MM_IOMUXC_GPIO1_IO06_GPIO1_IO6		0x19
+			MX8MM_IOMUXC_GPIO1_IO07_GPIO1_IO7		0x19
+			MX8MM_IOMUXC_GPIO1_IO14_CCMSRCGPCMIX_CLKO1	0x59
+		>;
+	};
 };