From patchwork Fri Nov 30 07:58:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 10705903 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2234014BD for ; Fri, 30 Nov 2018 08:08:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1411A2E52B for ; Fri, 30 Nov 2018 08:08:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07BB32F7AB; Fri, 30 Nov 2018 08:08:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FB662F7A3 for ; Fri, 30 Nov 2018 08:08:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726825AbeK3TQa (ORCPT ); Fri, 30 Nov 2018 14:16:30 -0500 Received: from mirror2.csie.ntu.edu.tw ([140.112.30.76]:50224 "EHLO wens.csie.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726788AbeK3TQa (ORCPT ); Fri, 30 Nov 2018 14:16:30 -0500 Received: by wens.csie.org (Postfix, from userid 1000) id 60E0F5FDF9; Fri, 30 Nov 2018 15:58:55 +0800 (CST) From: Chen-Yu Tsai To: Yong Deng , Mauro Carvalho Chehab , Maxime Ripard , Rob Herring , Mark Rutland Cc: Chen-Yu Tsai , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/6] [DO NOT MERGE] ARM: dts: sunxi: libretech-all-h3-cc: Add HDF5640 camera module Date: Fri, 30 Nov 2018 15:58:49 +0800 Message-Id: <20181130075849.16941-7-wens@csie.org> X-Mailer: git-send-email 2.20.0.rc1 In-Reply-To: <20181130075849.16941-1-wens@csie.org> References: <20181130075849.16941-1-wens@csie.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Libretech ALL-H3-CC is compatible with the Orange Pi's camera sensor module. This module itself features a detachable camera sensor module ribbon connector, which is populated with a GC2035 sensor by default. The connector is also compatible with Bananapi's HDF5640 camera module, which features an OV5640 sensor. The Orange Pi module however does not activate the auto focus feature of the HDF5640 module. Enable the camera by enabling the CSI controller, I2C control bus, and adding needed regulator supplies. As the schematics for the module are not available, the regulators and GPIO lines controlling them are just an educated guess. Signed-off-by: Chen-Yu Tsai --- .../boot/dts/sunxi-libretech-all-h3-cc.dtsi | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/arch/arm/boot/dts/sunxi-libretech-all-h3-cc.dtsi b/arch/arm/boot/dts/sunxi-libretech-all-h3-cc.dtsi index 1eadc132390c..3252e1af59cd 100644 --- a/arch/arm/boot/dts/sunxi-libretech-all-h3-cc.dtsi +++ b/arch/arm/boot/dts/sunxi-libretech-all-h3-cc.dtsi @@ -52,6 +52,36 @@ }; }; + reg_cam_avdd: cam-avdd { + compatible = "regulator-fixed"; + regulator-name = "csi-avdd"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + startup-delay-us = <200>; /* 50 us + board delays */ + enable-active-high; + gpio = <&r_pio 0 0 GPIO_ACTIVE_HIGH>; /* PL0 */ + }; + + reg_cam_dovdd: cam-dovdd { + compatible = "regulator-fixed"; + regulator-name = "csi-dovdd"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + startup-delay-us = <200>; /* 50 us + board delays */ + enable-active-high; + gpio = <&r_pio 0 0 GPIO_ACTIVE_HIGH>; /* PL0 */ + }; + + reg_cam_dvdd: cam-dvdd { + compatible = "regulator-fixed"; + regulator-name = "csi-dvdd"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + startup-delay-us = <200>; /* 50 us + board delays */ + enable-active-high; + gpio = <&r_pio 0 1 GPIO_ACTIVE_HIGH>; /* PL1 */ + }; + reg_vcc1v2: vcc1v2 { compatible = "regulator-fixed"; regulator-name = "vcc1v2"; @@ -128,6 +158,26 @@ cpu-supply = <®_vdd_cpux>; }; +&csi { + status = "okay"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + /* Parallel bus endpoint */ + csi_from_ov5640: endpoint { + remote-endpoint = <&ov5640_to_csi>; + bus-width = <8>; + data-shift = <2>; + hsync-active = <1>; /* Active high */ + vsync-active = <0>; /* Active low */ + data-active = <1>; /* Active high */ + pclk-sample = <1>; /* Rising */ + }; + }; +}; + &de { status = "okay"; }; @@ -165,6 +215,37 @@ }; }; +&i2c2 { + status = "okay"; + + ov5640: camera@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + pinctrl-names = "default"; + pinctrl-0 = <&csi_mclk_pin>; + clocks = <&ccu CLK_CSI_MCLK>; + clock-names = "xclk"; + + powerdown-gpios = <&pio 4 14 GPIO_ACTIVE_HIGH>; /* PE14 */ + reset-gpios = <&pio 4 15 GPIO_ACTIVE_LOW>; /* PE15 */ + AVDD-supply = <®_cam_avdd>; + DOVDD-supply = <®_cam_dovdd>; + DVDD-supply = <®_cam_dvdd>; + + port { + ov5640_to_csi: endpoint { + remote-endpoint = <&csi_from_ov5640>; + bus-width = <8>; + data-shift = <2>; + hsync-active = <1>; /* Active high */ + vsync-active = <0>; /* Active low */ + data-active = <1>; /* Active high */ + pclk-sample = <1>; /* Rising */ + }; + }; + }; +}; + &ir { pinctrl-names = "default"; pinctrl-0 = <&ir_pins_a>;