From patchwork Mon May 16 11:58:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Krummenacher X-Patchwork-Id: 12850688 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 79CA7C433EF for ; Mon, 16 May 2022 12:03:45 +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:References:In-Reply-To: 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: List-Owner; bh=T+o7oWvjCGozixMvA0CSHn+7F+JnrLmAnePHU6lzie0=; b=PgBqXnS3GHw0aT iP4O7slLhhISjG8wZCTtUiPan7kma9YHZDUUokCdvqb5ZYw4BaC06nXe1WZGdILZ80RSk7V8vDT7d cuQcaTOQeW7M2AsUqsKad0r6qgqCTXeEOhWupCXHfV7LjAMf3Bk0bxb4mEn2UpQBAMI4DV3vTe7OG nwksvaAV3rt1rJ5kvfR4H2yHWXHiBLnSZ+ASbheHYvPxNSYZ9OEu5KUUezgM8ifmlGquxN6UW0b/I UthkKnDkxlvwQBi/GTp3Ym7HaIBm9r2SLT7NH2xgNx852p1TC76aoGsffMPKCs1DeTDsikS+djGuZ ZGluw0W2tHqrxExMNDTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqZQh-007R6Y-Gl; Mon, 16 May 2022 12:02:28 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqZNw-007Pe2-GW for linux-arm-kernel@lists.infradead.org; Mon, 16 May 2022 11:59:38 +0000 Received: by mail-ej1-x62e.google.com with SMTP id ks9so28180172ejb.2 for ; Mon, 16 May 2022 04:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eKqWeVdKRXTC0PRCpQ3WiXZdLhshSKyjEsxqGUT/HYc=; b=HOVL5KjJ8vLZnRuUW2KIYcrGAxudGUnJ+hwrzYqmdVzZkAxlxfk9QerQIxCDD//Rbk VmVqhnrTCkQ/ySHwiQzlUsEGPifjqJP2fBC8EatI00V+kHqzDJASctQl95vHmaaHmI6t XVg7JAKTze24nTs/M9dV9rl6Rpd83vbr3EtHjjBhFwZWhRc6TsJ0ARikICwP/UjbuuyR 9faK/4Y3L35YjxpIUMFMCtbJ2S3TSShiA/4f61RzQcu2opkQqSdjMaVIjlihZDnBptFR 92qdBE+7DzgWbU3zfbpyClqXH0gKOpyTFZQ7jEWkcH8eM2a0S0foyZDkigUXt42sjmmJ JPYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eKqWeVdKRXTC0PRCpQ3WiXZdLhshSKyjEsxqGUT/HYc=; b=mvST8cgDb0j8M9RfKotRR0DQslLREeEEzFyM5pWGw0Iw2Ut523f14vZSW30NNVRIk3 Sb6DFIktbnDgef6sBI+vnEeJYmusoiXnu6W1fqe/OOvTvL3/2QF3FtdEJjyPvXx37kwI PFcjB8GW2Xbl+ETYeRJ3OMl3acu2hmULrMM2Vj4AGPEmKW+oj4IzGj6IjNyEvznStwfT 4dbc7KMxVequ5RpVehAXk4dd4TQA4+te9NBHN/aFuR/aCisthiCX7xWxarnmHp+tjFzb /NEZ+qCTzTdU5xmjfM39XIicZgISYzAcokXOf8ItfAhPgl4dEefA4cQAsCiMI3MESP9o KQSA== X-Gm-Message-State: AOAM532rwrON94/KrwpA5bti3ywNqJpGP5OLHS2Ty+kLDnTB6ARmhDS8 9Un8pL3j1T2kO345z2eA8TE= X-Google-Smtp-Source: ABdhPJzjRyVMdvgn2cmwrSPAdySFmjd6bAJZiiS1JEC/F0scx+NlGXVoK/y8QYY59y9r0SKSK6JBfA== X-Received: by 2002:a17:906:8306:b0:6f3:da72:5ca1 with SMTP id j6-20020a170906830600b006f3da725ca1mr15039625ejx.606.1652702374743; Mon, 16 May 2022 04:59:34 -0700 (PDT) Received: from linuxdev2.toradex.int (31-10-206-125.static.upc.ch. [31.10.206.125]) by smtp.gmail.com with ESMTPSA id s18-20020a170906779200b006f3ef214dacsm3711008ejm.18.2022.05.16.04.59.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 May 2022 04:59:34 -0700 (PDT) From: Max Krummenacher To: max.krummenacher@toradex.com Cc: Oleksandr Suvorov , Fabio Estevam , Krzysztof Kozlowski , NXP Linux Team , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , Shawn Guo , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 11/17] ARM: dts: imx6q-apalis: Add ov5640 mipi csi camera Date: Mon, 16 May 2022 13:58:39 +0200 Message-Id: <20220516115846.58328-12-max.oss.09@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220516115846.58328-1-max.oss.09@gmail.com> References: <20220516115846.58328-1-max.oss.09@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220516_045936_609891_B7DC839B X-CRM114-Status: GOOD ( 14.33 ) 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: Oleksandr Suvorov The Apalis iMX6 modules allow connecting a mipi-csi video input. Add support for our OV5640 camera module but have it disabled. This allows to enable it in an overlay per the current system configuration. Signed-off-by: Oleksandr Suvorov Signed-off-by: Max Krummenacher --- arch/arm/boot/dts/imx6qdl-apalis.dtsi | 67 ++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi index 506d040ea37a..0d1004eede62 100644 --- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi +++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi @@ -29,6 +29,12 @@ status = "disabled"; }; + clk_ov5640_osc: clk_ov5640_osc_int { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + }; + lcd_display: disp0 { compatible = "fsl,imx-parallel-display"; #address-cells = <1>; @@ -96,6 +102,26 @@ regulator-always-on; }; + reg_ov5640_1v8_d_o_vdd: regulator-ov5640-1v8-d-o-vdd { + compatible = "regulator-fixed"; + regulator-always-on; + regulator-max-microvolt = <1800000>; + regulator-min-microvolt = <1800000>; + regulator-name = "DOVDD/DVDD_1.8V"; + /* Note: The CSI module uses on-board 3.3V_SW supply */ + vin-supply = <®_module_3v3>; + }; + + reg_ov5640_2v8_a_vdd: regulator-ov5640-2v8-a-vdd { + compatible = "regulator-fixed"; + regulator-always-on; + regulator-max-microvolt = <2800000>; + regulator-min-microvolt = <2800000>; + regulator-name = "AVDD/AFVDD_2.8V"; + /* Note: The CSI module uses on-board 3.3V_SW supply */ + vin-supply = <®_module_3v3>; + }; + reg_usb_otg_vbus: regulator-usb-otg-vbus { compatible = "regulator-fixed"; pinctrl-names = "default"; @@ -438,7 +464,6 @@ reset-gpios = <&gpio6 9 GPIO_ACTIVE_LOW>; /* MXM3_13 */ status = "disabled"; }; - }; /* @@ -617,6 +642,30 @@ scl-gpios = <&gpio3 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; sda-gpios = <&gpio3 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; status = "disabled"; + + ov5640_csi_cam: ov5640_mipi@3c { + compatible = "ovti,ov5640"; + AVDD-supply = <®_ov5640_2v8_a_vdd>; + DOVDD-supply = <®_ov5640_1v8_d_o_vdd>; + DVDD-supply = <®_ov5640_1v8_d_o_vdd>; + clocks = <&clks IMX6QDL_CLK_CKO2>; + clock-names = "xclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_cam_mclk>; + /* These GPIOs are muxed with the iomuxc node */ + powerdown-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>; + reg = <0x3c>; + reset-gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + status = "disabled"; + + port { + ov5640_to_mipi_csi2: endpoint { + clock-lanes = <0>; + data-lanes = <1 2>; + remote-endpoint = <&mipi_csi_from_ov5640>; + }; + }; + }; }; &ipu1_di1_disp1 { @@ -647,6 +696,22 @@ }; }; +&mipi_csi { + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + port@0 { + reg = <0>; + + mipi_csi_from_ov5640: endpoint { + clock-lanes = <0>; + data-lanes = <1 2>; + remote-endpoint = <&ov5640_to_mipi_csi2>; + }; + }; +}; + &pwm1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pwm1>;