Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp1122905rdf; Wed, 22 Nov 2023 06:16:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJPx+joF/0zdcFt82fF0/DLlLnRTZa5En4WtcOQJZONPe2epsNyf+knEEU/OgX+6Y4pLW8 X-Received: by 2002:a05:6870:5312:b0:1e9:b2e2:8754 with SMTP id j18-20020a056870531200b001e9b2e28754mr3156422oan.2.1700662596082; Wed, 22 Nov 2023 06:16:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700662596; cv=none; d=google.com; s=arc-20160816; b=L+oXh27CkorUEfZKdJiQbjG94gLpbHFaNGo3WMotf9+hMrWBHZaiGs7zKDIdKhyEy7 Y2rOjN3e9GdvKV5sWRWYSwlxh9HBizFJb3muAi7f2r/QN+btDryfGvn6ALAIjTAZsD5E TXnHCwH7nyiNXiMdJEmHsroyEKnal6w/LjJk2HKnZYY53eDVfq2HK3RwPCCyTf8vjLF8 T0Cjx+EEKIn8NKq+6DyNkDvRca/V0LFVZXR/f+u5w+4lMJdCxjgZZn4y7D4QAX1ExABH MDebmin9Q/yRluMVJoq18QaVFQ/3D89hi3x7hvcPi4EtwRSXR7HkjftyW9Kj9O+u5R5O 5sJQ== 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 :dkim-signature; bh=MbVQzX9cYR/++E90CQRNI6quSUpAd4A/5VEQuPiEtWI=; fh=PHVbIgf+UxIdrbueJ5cOSpcsisIa90hQUxmE2wscmBk=; b=uv0fk2Y8SeZwbxodXJMcRHtoB62jiMHH2AWHNb8DUiz9gKwrivmh8Czv1YHpt5uPx3 XQYbWKL62G/vPkBzDXjtTiuUfn7MzQj7mb0HbbH1dV5vbGnqwHRF84s5aWSdbI6oMdFj e89HJr5BPRoitwyAA4uE96KKdOSSlXQI9G2WY5HF3lP+YY/OARGK5aQFdnevHDsuVMgA jHtbgJuKQg+duJwmxoeFHj2Zs8b0ipYQqAqY4xELh+2dpa2vbvuDRbeAFZJvPLJs7ANt 9mz0Dvazs1XeahY+FjYpQ8mm6M4N4haqzK7uwUllYezxigyI6NwDyzDRegwZX0EYLgiL QAoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=lZr+F0YT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id gr7-20020a056870aa8700b001e538a31169si4668073oab.285.2023.11.22.06.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 06:16:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=lZr+F0YT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 224D78040C40; Wed, 22 Nov 2023 06:15:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344292AbjKVOPL (ORCPT + 99 others); Wed, 22 Nov 2023 09:15:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232190AbjKVOO7 (ORCPT ); Wed, 22 Nov 2023 09:14:59 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42692112; Wed, 22 Nov 2023 06:14:54 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1B494E0009; Wed, 22 Nov 2023 14:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700662492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MbVQzX9cYR/++E90CQRNI6quSUpAd4A/5VEQuPiEtWI=; b=lZr+F0YTNHF6CaCw6lHJBLFdVfhZhxauFXKIIof73388r5Z25FoeU03jC2xC38zSwS9znR v+jAMrKJDWwKy5a9e52nblfc0bo/AOyhmg/vmMexkxcw/j79DqP70k8riNP4ABYhuwk3No dzFRWGz1DFAxH1QMVwJ/OTKRQkzEF+NMZo/AsQOQ/Eb3N3yBdhVxBs/gsBvsaO3HdLKY+Y 2Ne/JpL/nZ5nVrseDzrXJhxFFVVrNRSnQ+eqooWs0XltLhJC/6vGJSPBjiwmZBtw4s8La3 bx/LwkxJQSZfQwwr9Jao53POWapJbl6++j5/CC4MXtnpwOvP4XADMtGe4n0C+A== From: Paul Kocialkowski To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , Laurent Pinchart , Michael Turquette , Stephen Boyd , Paul Kocialkowski Subject: [PATCH v7 6/7] ARM: dts: sun8i-a83t: Add BananaPi M3 OV5640 camera overlay Date: Wed, 22 Nov 2023 15:14:24 +0100 Message-ID: <20231122141426.329694-7-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231122141426.329694-1-paul.kocialkowski@bootlin.com> References: <20231122141426.329694-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: paul.kocialkowski@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 22 Nov 2023 06:15:47 -0800 (PST) Add an overlay supporting the OV5640 from the BananaPi Camera v3 peripheral board. The board has two sensors (OV5640 and OV8865) which cannot be supported in parallel as they share the same reset pin and the kernel currently has no support for this case. Signed-off-by: Paul Kocialkowski --- arch/arm/boot/dts/allwinner/Makefile | 1 + .../sun8i-a83t-bananapi-m3-camera-ov5640.dtso | 117 ++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 arch/arm/boot/dts/allwinner/sun8i-a83t-bananapi-m3-camera-ov5640.dtso diff --git a/arch/arm/boot/dts/allwinner/Makefile b/arch/arm/boot/dts/allwinner/Makefile index eebb5a0c873a..a0a9aa6595e4 100644 --- a/arch/arm/boot/dts/allwinner/Makefile +++ b/arch/arm/boot/dts/allwinner/Makefile @@ -277,6 +277,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ sun8i-a33-sinlinx-sina33.dtb \ sun8i-a83t-allwinner-h8homlet-v2.dtb \ sun8i-a83t-bananapi-m3.dtb \ + sun8i-a83t-bananapi-m3-camera-ov5640.dtbo \ sun8i-a83t-cubietruck-plus.dtb \ sun8i-a83t-tbs-a711.dtb \ sun8i-h2-plus-bananapi-m2-zero.dtb \ diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t-bananapi-m3-camera-ov5640.dtso b/arch/arm/boot/dts/allwinner/sun8i-a83t-bananapi-m3-camera-ov5640.dtso new file mode 100644 index 000000000000..5868ef11bdee --- /dev/null +++ b/arch/arm/boot/dts/allwinner/sun8i-a83t-bananapi-m3-camera-ov5640.dtso @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-2.0 OR X11 +/* + * Copyright 2022 Bootlin + * Author: Paul Kocialkowski + */ + +/dts-v1/; +/plugin/; + +#include +#include + +&{/} { + /* + * These regulators actually have DLDO4 tied to their EN pin, which is + * described as input supply here for lack of a better representation. + * Their actual supply is PS, which is always-on. + */ + + ov5640_avdd: ov5640-avdd { + compatible = "regulator-fixed"; + regulator-name = "ov5640-avdd"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + vin-supply = <®_dldo4>; + }; + + ov5640_dovdd: ov5640-dovdd { + compatible = "regulator-fixed"; + regulator-name = "ov5640-dovdd"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + vin-supply = <®_dldo4>; + }; + + ov5640_dvdd: ov5640-dvdd { + compatible = "regulator-fixed"; + regulator-name = "ov5640-dvdd"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + vin-supply = <®_dldo4>; + }; +}; + +&csi { + pinctrl-names = "default"; + pinctrl-0 = <&csi_8bit_parallel_pins>; + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + csi_in_ov5640: endpoint { + remote-endpoint = <&ov5640_out_csi>; + bus-width = <8>; + data-shift = <2>; + hsync-active = <1>; + vsync-active = <1>; + pclk-sample = <1>; + }; + }; + }; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pe_pins>; + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + ov5640: camera@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + + clocks = <&ccu CLK_CSI_MCLK>; + clock-names = "xclk"; + assigned-clocks = <&ccu CLK_CSI_MCLK>; + assigned-clock-parents = <&osc24M>; + assigned-clock-rates = <24000000>; + + AVDD-supply = <&ov5640_avdd>; + DOVDD-supply = <&ov5640_dovdd>; + DVDD-supply = <&ov5640_dvdd>; + + powerdown-gpios = <&pio 3 15 GPIO_ACTIVE_HIGH>; /* PD15 */ + reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */ + + rotation = <180>; + + port { + ov5640_out_csi: endpoint { + remote-endpoint = <&csi_in_ov5640>; + bus-width = <8>; + data-shift = <2>; + hsync-active = <1>; + vsync-active = <1>; + pclk-sample = <1>; + }; + }; + }; +}; + +&pio { + pinctrl-names = "default"; + pinctrl-0 = <&csi_mclk_pin>; +}; + +®_dldo4 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; +}; -- 2.42.1