Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp751878rdb; Tue, 23 Jan 2024 14:01:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IG198lp4VQ9D1vJdjKR1f/TLCGhEj5E5gXNkhWaVgCtkxcqM4B/fbIEtm5Uw9rrJhfAcjoU X-Received: by 2002:ac2:5e34:0:b0:510:d03:aedb with SMTP id o20-20020ac25e34000000b005100d03aedbmr328452lfg.127.1706047316773; Tue, 23 Jan 2024 14:01:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706047316; cv=pass; d=google.com; s=arc-20160816; b=C9g9CmoU+cqR3GHNbUgmpg6+382Ya1t+JjuZ37uuDtD16q5Lwc5m+AGNhEnTchEy+v xOkoRh587roxU5E7p1erGgW14RiZScTi1PTB30WRmjDgYiTGt6fTISCq0oOQuDdsi35V nkIsdeMUKTkv3PibM3rVHgLwganVYdA6SLyXsVDG3A09SyDrQW3RV2Co2SU07Pzvz5/z smGRxB4wAV0KDiMgIKBj74ATwKBrp3WUm7WEazDC19tB1NLFo3ENU1HINyUSY6/IVljg WH+y7x3lIvyJM6mnM0k5ZfRNW+tu87unkcUlCfgyH5TeqRvxDFUPCTvVMAQuNjXf722K HrFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=BjNyvMZEEXTpESQ0++1wN/k098NTXTJ7nWhYzzx1iBQ=; fh=F61UqhJTC84uxnCDlPg/cFD5HAhmzG+q4+zAHb3dT4A=; b=Y9hv962nkCjy/URAD7LQAw21lHgH8Ky2qw43OoUEi5ERYrBw6qJGkX5JU3tZAeAv2l QHEvL6GfWSuAL3sLKjXvT8BbJ0yYDfZ7OUUbevCTXrNV+4MJXzCnLRfsQ6GZB/gBFGP+ f2lQ+Hb0QRGEdQuG8k3q7rXSnknyk9PcWg0uj/7D+vJPQMUJwjb+g5/kpyutKawUkSan m5UMmT4m3u9+t5z27smVtlWgIi9TMyVM8PieZi8+Bt1kwSRn6hVUbv3B79/UkU8D1FId 1FQQUQDgcwaYnh+QXDVa+ea6oI7FcSaI25K3dkoLqryTeas/46XfzdGjMsCfJc6d9Oy6 /q2Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=zPC3wvSj; arc=pass (i=1 spf=pass spfdomain=xff.cz dkim=pass dkdomain=xff.cz dmarc=pass fromdomain=xff.cz); spf=pass (google.com: domain of linux-kernel+bounces-36105-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36105-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 8-20020a170906058800b00a30ee793ebcsi477819ejn.141.2024.01.23.14.01.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 14:01:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36105-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=zPC3wvSj; arc=pass (i=1 spf=pass spfdomain=xff.cz dkim=pass dkdomain=xff.cz dmarc=pass fromdomain=xff.cz); spf=pass (google.com: domain of linux-kernel+bounces-36105-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36105-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5A73C1F2611F for ; Tue, 23 Jan 2024 22:01:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4A2C4EB55; Tue, 23 Jan 2024 22:01:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b="zPC3wvSj" Received: from vps.xff.cz (vps.xff.cz [195.181.215.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B6964EB34; Tue, 23 Jan 2024 22:01:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.181.215.36 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706047303; cv=none; b=d9xu5YBXap02fsrOJ7iOIxT/ZuzbGkGTXT4B0IqmTl4KskoKMTJDKwnUlBnr6doqAUMOH1809hMKaphIQD6EWoK8Fy66jEj3DC7AMYLomcRbDNhH8Pi9FmuydG3c29rN/ZvzS17mB+IFFdGYnhPGJGnkSB5G2lM5fSFyB8wRKT8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706047303; c=relaxed/simple; bh=5lpUIhK3eSpspj99MI2TxolMrSCilk2rgng+Fd5SQcE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rOcnqHUovho/JVarieEU9v4ryz7NYh5fQ4UhH2yQiaSMDboYRqe1w1pi1uRAegaZhcG4VNR+0vWtuBBCK4pc4cCo62URRh+E1Y4FITcmDPZAatzkFu1Ntv7JUbB8JrckGPbcgVmsRqEgvDK7inRah0apgbPBrcgdyiVAQ3IcFB0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xff.cz; spf=pass smtp.mailfrom=xff.cz; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b=zPC3wvSj; arc=none smtp.client-ip=195.181.215.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xff.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xff.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1706047291; bh=5lpUIhK3eSpspj99MI2TxolMrSCilk2rgng+Fd5SQcE=; h=Date:From:To:Cc:Subject:X-My-GPG-KeyId:References:From; b=zPC3wvSj0b1CRtVEOCTGIwOEl2tJYgdsRJDn4vErMv+XOEtsf5Acja3CB+wmTI/xk X2vUgAjI4PPoIPGanxMF0Uk49hTkTX1jS/PLY2wWwpKYV8/BF2cWgHpuyM62zPIiCE 3jaV38aNNCgrzWJGWuwfDUHNBUQA7QxxwWVabsr0= Date: Tue, 23 Jan 2024 23:01:30 +0100 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Andrey Skvortsov Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Alain Volmat , Pavel Machek , Arnaud Ferraris Subject: Re: [PATCH] arm64: dts: sun50i-a64-pinephone: Add front/back cameras Message-ID: Mail-Followup-To: =?utf-8?Q?Ond=C5=99ej?= Jirman , Andrey Skvortsov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Alain Volmat , Pavel Machek , Arnaud Ferraris X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED References: <20240123214729.2852346-1-andrej.skvortzov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240123214729.2852346-1-andrej.skvortzov@gmail.com> Hi Andrey, On Wed, Jan 24, 2024 at 12:47:29AM +0300, Andrey Skvortsov wrote: > From: OndÅ™ej Jirman > > Pinephone has OV5640 back camera and GC2145 front camera. Add support > for both. The upstream driver doesn't support multiple endpoints per port. See: https://elixir.bootlin.com/linux/v6.8-rc1/source/Documentation/devicetree/bindings/media/allwinner,sun6i-a31-csi.yaml#L43 Only one endpoint is allowed/supported. Looking throught LKML, I don't see the support for multiple parallel interface endpoints being added recently... So this patch will not work, and will cause DTS validation errors. Kind regards, o. > Signed-off-by: Ondrej Jirman > Signed-off-by: Andrey Skvortsov > --- > .../dts/allwinner/sun50i-a64-pinephone.dtsi | 91 +++++++++++++++++++ > 1 file changed, 91 insertions(+) > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi > index 87847116ab6d..4104a136ff75 100644 > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi > @@ -36,6 +36,15 @@ chosen { > stdout-path = "serial0:115200n8"; > }; > > + i2c_csi: i2c-csi { > + compatible = "i2c-gpio"; > + sda-gpios = <&pio 4 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; /* PE13 */ > + scl-gpios = <&pio 4 12 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; /* PE12 */ > + i2c-gpio,delay-us = <3>; > + #address-cells = <1>; > + #size-cells = <0>; > + }; > + > leds { > compatible = "gpio-leds"; > > @@ -124,6 +133,36 @@ &cpu3 { > cpu-supply = <®_dcdc2>; > }; > > +&csi { > + pinctrl-0 = <&csi_pins>, <&csi_mclk_pin>; > + status = "okay"; > + > + port { > + #address-cells = <1>; > + #size-cells = <0>; > + > + csi_ov5640_ep: endpoint@0 { > + reg = <0>; > + remote-endpoint = <&ov5640_ep>; > + bus-width = <8>; > + hsync-active = <1>; /* Active high */ > + vsync-active = <0>; /* Active low */ > + data-active = <1>; /* Active high */ > + pclk-sample = <1>; /* Rising */ > + }; > + > + csi_gc2145_ep: endpoint@1 { > + reg = <1>; > + remote-endpoint = <&gc2145_ep>; > + bus-width = <8>; > + hsync-active = <1>; > + vsync-active = <1>; > + data-active = <1>; > + pclk-sample = <1>; > + }; > + }; > +}; > + > &dai { > status = "okay"; > }; > @@ -158,6 +197,58 @@ &ehci1 { > status = "okay"; > }; > > +&i2c_csi { > + gc2145: front-camera@3c { > + compatible = "galaxycore,gc2145"; > + reg = <0x3c>; > + clocks = <&ccu CLK_CSI_MCLK>; > + clock-names = "xclk"; > + avdd-supply = <®_dldo3>; > + dvdd-supply = <®_aldo1>; > + iovdd-supply = <®_eldo3>; > + reset-gpios = <&pio 4 16 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PE16 */ > + powerdown-gpios = <&pio 4 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; /* PE17 */ > + rotation = <270>; > + orientation = <0>; > + > + port { > + gc2145_ep: endpoint { > + remote-endpoint = <&csi_gc2145_ep>; > + bus-width = <8>; > + hsync-active = <1>; > + vsync-active = <1>; > + data-active = <1>; > + pclk-sample = <1>; > + }; > + }; > + }; > + > + ov5640: rear-camera@4c { > + compatible = "ovti,ov5640"; > + reg = <0x4c>; > + clocks = <&ccu CLK_CSI_MCLK>; > + clock-names = "xclk"; > + AVDD-supply = <®_dldo3>; > + DOVDD-supply = <®_aldo1>; /* shared with AFVCC */ > + DVDD-supply = <®_eldo3>; > + reset-gpios = <&pio 3 3 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PD3 */ > + powerdown-gpios = <&pio 2 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; /* PC0 */ > + rotation = <90>; > + orientation = <1>; > + > + port { > + ov5640_ep: endpoint { > + remote-endpoint = <&csi_ov5640_ep>; > + bus-width = <8>; > + hsync-active = <1>; /* Active high */ > + vsync-active = <0>; /* Active low */ > + data-active = <1>; /* Active high */ > + pclk-sample = <1>; /* Rising */ > + }; > + }; > + }; > +}; > + > &i2c0 { > status = "okay"; > > -- > 2.43.0 >