From patchwork Fri Jul 14 03:08:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13312893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1DE0EB64DD for ; Fri, 14 Jul 2023 03:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fOQM88zZIG6ugpZoUC24G5bw6roOIOJ/24rrI27f83E=; b=XbdiSMS9HuOgdi d5s0DPAO+csHEKkod6oJIZMM9jffbllZsm+l5j/7/Biv6A9p6yWejpZVvhr17vqe4YWZM9NW/X7Z9 Ac9cJLpORtJ609GaXtDqLUzFi8k1Kgs56mSt4Ca9546XfScdRGKW7pwCbaf0grdeQIfRYEyhzDdzJ Di3h9GWc9dSpnEFTTGAdteNu9PItXmFeTASInoUJKE1ajsvDO12y7gcOIiYnW1RdDsQku1S2yYgNn Nf+ozMrxBzQTfxFLu88pOUPUpb62n3ocxC8qaRjHBtX4Hghsctlglokk3pLAL0NgfhQelcGSXVEZO 5EiZZwYGEKJKqc4vj3EQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qK9AM-004rfw-0R; Fri, 14 Jul 2023 03:08:22 +0000 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qK9AJ-004rex-1Z for linux-arm-kernel@lists.infradead.org; Fri, 14 Jul 2023 03:08:20 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-1b06d1f3868so276335fac.1 for ; Thu, 13 Jul 2023 20:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689304097; x=1691896097; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6S2Q7Xb+MuNczoJUJS6yXaZ6Mx6C0z8Jzj2Ork8jb8A=; b=iRNaZIv0a9i4TLlM0t5jPrrV6X072fSadUhGVEuIgqZ5i+s+sdxJXcTdEzB+XCijFF V3+165+14qakh1PdiNvC1SJsW0DjII5YfJwplW7l6IaBzreuDUoW+VXvG3h0huO1sQDW DpOqYNZ3m/vuMsddjnz03jaeOnUWO3Fn3MmjkGSnfhM3JBDIt6t09ZUArOftjUcWJOtA HmhMmcwQb/zVV8imQDJOKJk/ODowzmPC2isDJV1lIpTUv6KFhLZrfsBTbQZc581w/zF7 b3Roi4setZmyRAemkR6/UKTH8KRlaTwVrnhq0DK8TJRARfGu92M7d09+jmYRxaVO4Aml GMSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689304097; x=1691896097; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6S2Q7Xb+MuNczoJUJS6yXaZ6Mx6C0z8Jzj2Ork8jb8A=; b=W7GWiF2bKHOxRt+0dRU8Yx1ek5BiljWqiutuvxbvyH/ft/ny31hPY/OrmHA0MI791Q lGLhewRJqWzBMBUZUkB3hAH3h9ExKds9yXFvjIBDUbFNI9x+ur7KaagmEXKQk9gGfLUr eSrQIvGMrKTNLpsW6W8m/8iDRvEfuBviRTxrZb1FVY3SRQ34B9QQCgH0cnfWPhSKa6r/ UPW0SSi9hFOObAXaGgrv7+wAkD221VcRV+4czxT40XBLf7vbG80LfDqlqLkMHVlgHHYA bSw9rQ6gKPxaBc2uXmbYv2c4WPZnGkmzy6LUuaVakx+TaT6OidAKN47JGlQ+CRsavHru WPfg== X-Gm-Message-State: ABy/qLa7YnFT7qdEeiD3K5rYR+0ZpwXQgHCgKHHpTQlOpAvpoW0ZUxhq ao291mMa3of1BXxuFU/mvVI= X-Google-Smtp-Source: APBJJlHVqrIC+FYMNikhJpK3FYVwW5PtACTAP5jWrbdjfDM0/riY7Qs2ixJW2ntoPYZxlA5WH59kgA== X-Received: by 2002:a9d:53cc:0:b0:6b9:a7b2:5217 with SMTP id i12-20020a9d53cc000000b006b9a7b25217mr2727942oth.2.1689304097134; Thu, 13 Jul 2023 20:08:17 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:f31b:1601:f0:5130]) by smtp.gmail.com with ESMTPSA id c5-20020a9d67c5000000b006b9a693a1acsm1637851otn.66.2023.07.13.20.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 20:08:16 -0700 (PDT) From: Fabio Estevam To: shawnguo@kernel.org Cc: linux-arm-kernel@lists.infradead.org, tharvey@gateworks.com, aford173@gmail.com, Fabio Estevam Subject: [PATCH] arm64: dts: imx8mm-evk: Add camera support Date: Fri, 14 Jul 2023 00:08:09 -0300 Message-Id: <20230714030809.1538069-1-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230713_200819_521941_A6D04888 X-CRM114-Status: GOOD ( 10.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Fabio Estevam 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 --- arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) 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 + >; + }; };