From patchwork Wed Jun 15 11:50:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Krummenacher X-Patchwork-Id: 12882238 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 552E0C433EF for ; Wed, 15 Jun 2022 11:57:22 +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=AHohWxw/erBjriCfNvgVCGuu4RROsfppxEKOwBwhalQ=; b=LQMO1GmqXvxrn9 dBbrWoCwcZ8VtcNF5OFLG0MPQOwd/I8Gq1x7ILBcFVtpemZ5rJy/g4zkr0o1V0erjTXn4OuSa+T5l O+9peNc1cNXVKmC2oXvlRzB8RkVIATDdRPli2w1H1qjpTkvV27Qaw6jhwybs5s1w3ks8Vov8sObAr 4UAFcxjIgZV3r/RzwfafE9KBTedwrbSvCKj+5vEPg+ZmYsyGR9kn/koAYLJNmxHHJcJ5srHuum/8t 8Fbi5UeP/NHgTZxKwXhP5MeUE7v5labaQ+UvjrsRv8bLWMy0KxO3YZ5MlQAP/URBkaBxVTeDUDeAC E2DFAbhywEfxBaqkiYsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1Rd4-00EJQ1-8J; Wed, 15 Jun 2022 11:56:10 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1RY4-00EGoO-PS for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2022 11:51:02 +0000 Received: by mail-ed1-x52a.google.com with SMTP id z7so15702927edm.13 for ; Wed, 15 Jun 2022 04:50:59 -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=HENmXPwQgZrLvgBCOSxbn3j3qup91Vw70nnac08YVQI=; b=DUgSbBif0rvoVLNJXtj/ChM9YSBp5WGCaDECnnql+GX3hRdyoqgIuQ2xRZFqjedHAf cnEJo5iClqIkgWsSOUF8paCNyTTFWHdWmuvUrd0CEjfkhgikfT+jbe6lbSKDZrKwELoJ 22EmOIDiL+3X0CxgGcJ3i5ogwduadexq5qYRuM1L03r294jQwybtnqgQdHrbmKzdgK8a De2+Y8SBzqolsZauWOELhNie/rBqvlLIMw3SflSQvAdwyAYNRfjUCH5oFZcgtv6XrKSP NcSF4PrhRiOXbY0o5a6a+3xvgGdk4fWeRuQx2TmqZjpReXX+XO6l+3KLKH97sniqnNUL LBdA== 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=HENmXPwQgZrLvgBCOSxbn3j3qup91Vw70nnac08YVQI=; b=scsjt4IEkxtS5YhGC0kBqc40xGvILk7kOYFfZP0pvrsgnmu0LctWuk8Qm/nklB3tRS vITGN4xJUkVjoakjROdNR/DPrMi1uxLBYwe9bI21aSrq8Aack8/Gg/xR4UBVRbmKDOKI ZVEH4xOO3zOaY5QVlmkG8Nms5fjik/BB5Ziu5tVTOsJmjRRQZa8NGbEcifZY052Q2hXg QUvHdSpwqyB6SSSbLNr1GlEaA9BgJVdhlY3NgJPx3UiOXVosE7/oAwmf2WSyPXOdU2/i p8vc8KxKdF1G53kJiRRzJCGYa2oT26GjBDKGRvFaisZwqqPekACpPCn04cA0uBceqlzQ 2/1A== X-Gm-Message-State: AJIora/Gsu/+tME3kKM0NLmtjhvYHMYcQxcIMYG17tsCXEb7amt7b0Qn TkcCcMF75ddnbVAfdsq5HqM= X-Google-Smtp-Source: ABdhPJxqZWDzakNuE6KjaWfgvQSS+/by8OipbRpgC430xggG4gd/kgHQG9SoHcWJf/IeTObyU0iXwA== X-Received: by 2002:a05:6402:32a6:b0:42d:ed8b:3d8 with SMTP id f38-20020a05640232a600b0042ded8b03d8mr12220196eda.225.1655293858511; Wed, 15 Jun 2022 04:50:58 -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 t6-20020a17090616c600b00715a02874acsm4561158ejd.35.2022.06.15.04.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 04:50:58 -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 v2 12/18] ARM: dts: imx6q-apalis: Add ov5640 mipi csi camera Date: Wed, 15 Jun 2022 13:50:00 +0200 Message-Id: <20220615115006.45672-13-max.oss.09@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220615115006.45672-1-max.oss.09@gmail.com> References: <20220615115006.45672-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-20220615_045100_887153_046B1E5A X-CRM114-Status: GOOD ( 15.05 ) 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 --- Changes in v2: - Fixed '-' vs. '_' in node name as pointed out by Fabio - Sorted properties alphabetical in the newly added node 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 b4742ad85f56..bbd838acb8d6 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 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + }; + gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default"; @@ -110,6 +116,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"; @@ -452,7 +478,6 @@ reset-gpios = <&gpio6 9 GPIO_ACTIVE_LOW>; /* MXM3_13 */ status = "disabled"; }; - }; /* @@ -631,6 +656,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>; + clock-names = "xclk"; + clocks = <&clks IMX6QDL_CLK_CKO2>; + 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 { @@ -661,6 +710,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>;