From patchwork Tue Jan 23 21:47:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Skvortsov X-Patchwork-Id: 13528178 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 2BC07C47258 for ; Tue, 23 Jan 2024 21:48: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=MkStEpS7ow1BYJ+dAQWK8nxK/+9ZTd+s8DW1a/73rsw=; b=SbtNrKXXKaWVR1 s3jmlCUk5ngl1LU8+8ziAeQjB4b62hhxKpXSIxxLGBe/Dlk9z7wFTXJpmHUdU9JXI6TamDX4LmWCk M3ASl023aqzkCE0WvFTRgtz6by7Qa0S05t9fFQfwY+97c7s7n6CpeHI07SETdHcDUDeepcFZCER/x FBi8L/Hq3RT/zPcg00jhtMBvHP8IAlAUG8wgWNEmf9ZYACe0X5OAkXZ0GpSmNTT4JVA7JGA0rK+5c n52Z444PMqGAaA+wgSBzfexFugHEf07nbFzaihzE1YEoOaBdl5W0W+adDQ2JxtzrI8VxFifxryzLr cDW2uyzd41fIDTM71KtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSOd4-000Zkp-1z; Tue, 23 Jan 2024 21:48:22 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSOd1-000Zhq-1Z for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 21:48:20 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-50eabd1c701so5413448e87.3 for ; Tue, 23 Jan 2024 13:48:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706046490; x=1706651290; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hxTUu07Tw3JZQ4EBg2GvG/6CFogECC0naJLXgFJuN6s=; b=fga3/qBhdxEP4eLWXI5o5iJKzW1P3Z0c+XelAOaYv9Zr1gKed32A4EXDcBvia+jvr6 CFak9nfxjAHOEV+A8qkLAYnACWH8ErF7m2dYGnMMw22HK95GbhENwbcebTfcmElGzO6s GlWnZvF0RnZk05h8gMyCCffBz4j9XjqQE9ObQ/6mx2AtnpZhXMM4owdXO8fYlZVEHdMf 8nnEy4S1IueA+YnxAS7ja2pkstHo6tejiNywriP+4Qk3NRUmm80MaeCoZx+QyeaBTWz/ vSA7pXGD+bPBeUXo1aAjX8TzisF24iMvYC6v0C/5SsDA9ebyh1arQ+VSy3h6Anszi03e MXGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706046490; x=1706651290; 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=hxTUu07Tw3JZQ4EBg2GvG/6CFogECC0naJLXgFJuN6s=; b=sWYQOb5/ohrtnPPm/8Gmql/m4A/miP3T4mPo6H1bU/E18FbHEWJIxkUvsXpVpjX3em swrbbJY04hfUbKQrNpBXwlSjZ2Xarz1lkKrhH0yQttJNiGJTPT1TJ2NIw/R3dtfFnGHd 29sbjJzttS4K47zKQwv2U6vbmX2JMtbw86FSAUwNcjxrL5puJJPKbwHiOu/6mWlk4dfL EJjDB3YBuAbnhUEXI1wBp+x9ChOcpYQIX6/3460xzKc9eXGUvwVKr76IYCpPE8FWT0SP aFNwILWkQssBufcEdRK7yhPIvfhQzKHYFWLeQHcAfBCyuxaS3pGcTNzu6G3flew38cj0 dK7Q== X-Gm-Message-State: AOJu0YzdAgYyTpTqLS94lk/ytNQYVRIe1FdY3vbclpy+0kpZ69hyDVhF D2Wh90ztc8fM00o6oNbCXss+OKUJ2GtIya1cQUYnZHAgT7+SPaHQ X-Google-Smtp-Source: AGHT+IHZ4f7jIFRNJ+6G/KFQ8DhBSxZWT2NG2LD0URxwP0fjG+Ik3wpsd03v9PwttJz5KM4uopPA3g== X-Received: by 2002:a05:6512:ba5:b0:50e:8e74:6406 with SMTP id b37-20020a0565120ba500b0050e8e746406mr4251539lfv.36.1706046489310; Tue, 23 Jan 2024 13:48:09 -0800 (PST) Received: from localhost.localdomain ([2a05:3580:f312:6c01:1b8f:2a1b:d18:1951]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b005100c6c925csm133993lfh.88.2024.01.23.13.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 13:48:08 -0800 (PST) From: Andrey Skvortsov To: 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, Ondrej Jirman , Alain Volmat , Pavel Machek , Arnaud Ferraris Cc: Andrey Skvortsov Subject: [PATCH] arm64: dts: sun50i-a64-pinephone: Add front/back cameras Date: Wed, 24 Jan 2024 00:47:29 +0300 Message-ID: <20240123214729.2852346-1-andrej.skvortzov@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_134819_535911_14995056 X-CRM114-Status: GOOD ( 12.21 ) 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: OndÅ™ej Jirman Pinephone has OV5640 back camera and GC2145 front camera. Add support for both. Signed-off-by: Ondrej Jirman Signed-off-by: Andrey Skvortsov Signed-off-by: Pavel Machek --- .../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";