Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1662806pxb; Thu, 4 Nov 2021 06:26:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyNFUn3oK4tz0HRE5OiDzSzcyXh1jXQ+e/dWkrSoeWbH63HfX2/0U3DqgoEJGnZ84SUmog X-Received: by 2002:a05:6e02:1a4f:: with SMTP id u15mr13311579ilv.115.1636032399763; Thu, 04 Nov 2021 06:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636032399; cv=none; d=google.com; s=arc-20160816; b=a+IBQf6NaPB16qtSTy6M6stpCe5hdalv6hl4aFDitq1hNuvpske/EWpkQ5O+DdWmx4 2RVQiiXUFV1pTGkfRTA1SiESGcLyBLVhKHPMA22QX0KSd2XT9nlsIBb9pRwO4YH6u3ca UrMdNfXhU7IweAExyxye8U00t6saS6RVKnS7uOZdUace5OTVCielZTJF5FW/QmgAuknR U+Rj/5dSpfNAkoGpXD96ttoo0D5mDT7u/eT67Zpl7rbbE4ERJZienChfKxwcD/OsgIk9 F6SCl5ndj4HLlUAKjy1YZ9DAZ3elSYcdX9ZvPyqb2TZijSQ5mTxZCCicb1Aq1ttYnukw jU7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=XfOxOw5dC5pzxIkjcFWid82ECKSyAdmZP69lXhrWNTE=; b=U8i1VaYxnefizA7/r71tMPI5dk1Huu8UfQVEZ+FeSoPP7Z+uFnzwgcYHF7GdUA763k hATvuM7HBk1+zP2DTLpOpqcqz8BUZe/3Nj0O+CpnW9l6Jdxs8/izywiKPVSMl2c67E9Y m1J+RkAkb/T8r9av402gVxaF8B/1GspHlvWn/3UCEAMk6c6ImRvA9nmvOKwb0AkGUf3E FGfbNtXzEtx9VHGqERhKAgJlbZ38tBHDR3HlZqcbQzKeH8kZXiT8+EZAV/N5C61khAuD hK0PXgNyyK1iezcOh14kv/8aZfcDiK9LW1HKUEU51psa9qj8ROHDaaKi+C6AZdap/lO8 q5Uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si10398422ila.103.2021.11.04.06.26.23; Thu, 04 Nov 2021 06:26:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231676AbhKDN0W (ORCPT + 99 others); Thu, 4 Nov 2021 09:26:22 -0400 Received: from comms.puri.sm ([159.203.221.185]:42118 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231612AbhKDN0V (ORCPT ); Thu, 4 Nov 2021 09:26:21 -0400 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 6CE91DFE40; Thu, 4 Nov 2021 06:23:43 -0700 (PDT) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jczG3ziMWlEL; Thu, 4 Nov 2021 06:23:42 -0700 (PDT) From: Martin Kepplinger To: festevam@gmail.com, shawnguo@kernel.org Cc: martin.kepplinger@puri.sm, devicetree@vger.kernel.org, kernel@pengutronix.de, kernel@puri.sm, krzk@kernel.org, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, robh@kernel.org Subject: [PATCH v1 3/4] arm64: dts: imx8mq-librem5: describe the selfie cam Date: Thu, 4 Nov 2021 14:22:12 +0100 Message-Id: <20211104132213.470498-4-martin.kepplinger@puri.sm> In-Reply-To: <20211104132213.470498-1-martin.kepplinger@puri.sm> References: <20211104132213.470498-1-martin.kepplinger@puri.sm> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable the CSI1 MIPI RX controller and CSI1 bridge on the SoC. Describe the Librem 5 front-facing camera, connected to the CSI1 MIPI. the following sets formats, streams 10 frames and saves one: #!/bin/bash WIDTH=1632 HEIGHT=1224 SKIP=10 media-ctl -d "platform:30a90000.csi" --set-v4l2 "'csi':0 [fmt:SGBRG10/${WIDTH}x${HEIGHT} colorspace:raw]" media-ctl -d "platform:30a90000.csi" --set-v4l2 "'imx8mq-mipi-csi2 30a70000.csi':0 [fmt:SGBRG10/${WIDTH}x${HEIGHT} colorspace:raw]" media-ctl -d "platform:30a90000.csi" --set-v4l2 "'hi846 2-0020':0 [fmt:SGBRG10/${WIDTH}x${HEIGHT} colorspace:raw]" media-ctl -d "platform:30a90000.csi" -l "'hi846 2-0020':0 -> 'imx8mq-mipi-csi2 30a70000.csi':0 [1]" v4l2-ctl -d "/dev/v4l/by-path/platform-30a90000.csi-video-index0" --set-fmt-video=width=${WIDTH},height=${HEIGHT},pixelformat=GB16 --stream-mmap --stream-to=$WIDTH.raw --stream-skip=$SKIP --stream-count=1 Signed-off-by: Martin Kepplinger --- .../boot/dts/freescale/imx8mq-librem5.dtsi | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi index 5541e1d2ec6f..b3f165822e56 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi @@ -271,6 +271,10 @@ &A53_3 { cpu-supply = <&buck2_reg>; }; +&csi1 { + status = "okay"; +}; + &ddrc { operating-points-v2 = <&ddrc_opp_table>; @@ -1006,6 +1010,31 @@ codec: audio-codec@1a { >; }; + camera_front: camera@20 { + compatible = "hynix,hi846"; + reg = <0x20>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_csi1>; + clocks = <&clk IMX8MQ_CLK_CLKO2>; + assigned-clocks = <&clk IMX8MQ_CLK_CLKO2>; + assigned-clock-rates = <25000000>; + reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; + vdda-supply = <®_vcam_2v8>; + vddd-supply = <®_vcam_1v2>; + vddio-supply = <®_csi_1v8>; + rotation = <90>; + orientation = <0>; + + port { + camera1_ep: endpoint { + data-lanes = <1 2>; + link-frequencies = /bits/ 64 + <80000000 200000000 300000000>; + remote-endpoint = <&mipi1_sensor_ep>; + }; + }; + }; + backlight@36 { compatible = "ti,lm36922"; reg = <0x36>; @@ -1079,6 +1108,23 @@ &lcdif { status = "okay"; }; +&mipi_csi1 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + ports { + port@1 { + reg = <1>; + + mipi1_sensor_ep: endpoint { + remote-endpoint = <&camera1_ep>; + data-lanes = <1 2>; + }; + }; + }; +}; + &mipi_dsi { #address-cells = <1>; #size-cells = <0>; -- 2.30.2