Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp747047rdb; Tue, 23 Jan 2024 13:50:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHK9842tMgcBoWUVyJo6osfS6ptaBVn++VmnfF1yBgzNV+zcVr69vNMSZkGXMmx+/Oau1+R X-Received: by 2002:a05:6a20:144b:b0:19c:5711:fd93 with SMTP id a11-20020a056a20144b00b0019c5711fd93mr2190365pzi.16.1706046617873; Tue, 23 Jan 2024 13:50:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706046617; cv=pass; d=google.com; s=arc-20160816; b=IKn0popyaY2s69BgiEb/Cidad1A6zDWla2nwLlBmph2t/IMnV0ShKJQwQFhwQkoccp fOq6+U4LAiujDrLu/I6fL0NHgWVe/SAbvFbpKqaZBDeLUszCGxiiXS2JIdvAQ8MphFah qP2A0E7U/VOy2OlguA8Pi5JMxPqFvU0d5cOvNSoEYEU8qYcyC1f8n1Y9OGe1dojiAaPI /t7mf6bASMUi+nedtnDTrx3ApteY/RmqjAJT/qZBFZzogQId7bc9CxuXeH49RQnjzlck YS70JeK5mTi5m/+njAZW9yese/DC5usz2X8AhDgnYGk6dUuInm5zxXnlMW7ee+8V19HW HSIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=hxTUu07Tw3JZQ4EBg2GvG/6CFogECC0naJLXgFJuN6s=; fh=PCY3XMZmMoH72+2Pq4gYfRqgTXNN4Aa4XZvfLyFotEQ=; b=h8sPOmaqiVetD0yD5uMrr+J4GDC2IZdY/ur6d11T4IgABHuPCjvi6RVoU9cjs5tN3d uvenkcN9wo/TZbDlgt52eGtYBQxntd4nyff9Lufb+Gisch5LD4bBJH9WtjoP2CN5hmxS y46KVsq20rAzn2fbc8vHBBIAi5IyuGczBaRNx6hCbDiNLpm8M2TCdNpvnUuxWPflZARI UP4DfAzB13eUfp+xwSOD3ZK6BM51JawzGpUTNCNibUT65gZ8KKNKrxpqVvOn6vavbPgw hl5hdPDOzmROQtD+0/vz63WoOxTQ4F54LYoQWY/1TK63hSJc0zXtAoWzK2yMv3KxQTyd 7wuQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="F/Co6aqA"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-36088-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36088-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ng10-20020a17090b1a8a00b0028beb2f8f61si10644880pjb.43.2024.01.23.13.50.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 13:50:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36088-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="F/Co6aqA"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-36088-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36088-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 08AD228D261 for ; Tue, 23 Jan 2024 21:48:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B8CF246525; Tue, 23 Jan 2024 21:48:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F/Co6aqA" Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 29DD34D5BF; Tue, 23 Jan 2024 21:48:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706046493; cv=none; b=be5XEnuG+eflRaE7NQvSjkWlrlNafB8J8etH0MDSGXe1ekNO2JJovgp+FWG185LORWbK8oquNmPEr5kMu74P1OOrFq8LKUt5xLYeatlEFKppLzxM7QKR7N6bvU5qIiUjSSrIdTjeKP2uwRUi71g4fhOpvUrFg5jNBFl4rAwIsVI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706046493; c=relaxed/simple; bh=cot/RLa5B+VvYdjsSjzRhdQNUXnW5oMxtw+aZzsx/eQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=k1CKlPiJ1hyKYtGOgGCrvMUGvv+A7txELCoGQubQvHm/3RwiEDu0vlb63dkgqH0TxWBurc0+SYAGnrPnbK2ngp9W4QVoowBqf5TbXu1PsqD831uwiBUi0On4SSgNM3EtR6gvqrJ+ShY6RFMfSAkQby3jn5SIz18wQd0NURVSTlc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=F/Co6aqA; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-50eabd1c701so5413449e87.3; 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=vger.kernel.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=F/Co6aqAvuJqfeuTjTuu87DQGc9AEEvs/vOkBdY5dDnOWmA0qGN9mCEls1xTGUQoRw V4pmAK4601QdSnwIV74zEsD2HxTGRVBKk9A+8gAplBtLx+zZiLwvBPfrH23eLNdK2Upp uZguPYQAI5D+p7jyTox4OLsDDJf067J7nv62ZLLsqFcjODapSKtPBESmyO+UmwHXRxXR rp+P8HCOnS1ugTJcTNhrTygMxK6lPcxDNYqNtN0KtQUL1wxRlKDNma1voOFlHIs7uASZ +HNZA4L+QesAlwEAZQYSgX1Uc/3wVn6TRyhoN27EFtP4gc8J4FZyV/2yFyPRy8GXfb7c dvdg== 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=F/NIBHgJ/80miEuAFf6JVDdxDq4au8XI8FUpE6jb8T5M9g1i8SENCE/Pjp7anYcirJ 2Mr9+SFkrVaq9Z1wlGsJJpo3bWwEj62ZynaPCiz6CLWhDsRFPIbfOBfj3Dqf5c5wO3bn r5mWRcRAjJnajquzsRj4eNpv7Ru7fDRkPOrNq022h/WfyyYRgDtcHp8vZTBC4gM5VxXH J1RG6qkJ325lNEjxzI9R0BOgLlZvDd3h6g2EQjV1Mscii61I75m9CkzENE/MV8WVPSBF yIFD+8JRggjl0x/2f2pAHFj5ZylK85q6GAISN/jhT5wbPJl61rLcBWPZcqyqYjD0AOMq Ddjg== X-Gm-Message-State: AOJu0Yy84J6f5Xj5JEQrugxpI4QOxc7U4vWvbSARdKNKjVg33ILLrFE7 I/GuCJzIPkGg9+drjRuy7Ti+E472yjhVE/B9fhCFiqW2vFM0gJud 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 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-Transfer-Encoding: 8bit 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 --- .../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