devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@csie.org>
To: Yong Deng <yong.deng@magewell.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>
Cc: Chen-Yu Tsai <wens@csie.org>,
	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	[thread overview]
Message-ID: <20181130075849.16941-7-wens@csie.org> (raw)
In-Reply-To: <20181130075849.16941-1-wens@csie.org>

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 <wens@csie.org>
---
 .../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 = <&reg_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 = <&reg_cam_avdd>;
+		DOVDD-supply = <&reg_cam_dovdd>;
+		DVDD-supply = <&reg_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>;
-- 
2.20.0.rc1

  parent reply	other threads:[~2018-11-30  7:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30  7:58 [PATCH 0/6] media: sun6i: Separate H3 compatible from A31 Chen-Yu Tsai
2018-11-30  7:58 ` [PATCH 1/6] media: dt-bindings: " Chen-Yu Tsai
2018-12-03  9:41   ` Jagan Teki
2018-12-03  9:48     ` Chen-Yu Tsai
2018-12-04 13:13       ` sakari.ailus
2018-12-12  2:33   ` Rob Herring
2018-11-30  7:58 ` [PATCH 2/6] media: sun6i: Add H3 compatible Chen-Yu Tsai
2018-12-03  9:42   ` Jagan Teki
2018-11-30  7:58 ` [PATCH 3/6] ARM: dts: sunxi: h3/h5: Drop A31 fallback compatible for CSI controller Chen-Yu Tsai
2018-12-03  9:44   ` Jagan Teki
2019-01-24 10:15     ` Chen-Yu Tsai
2018-11-30  7:58 ` [PATCH 4/6] ARM: dts: sunxi: h3-h5: Add pinmux setting for CSI MCLK on PE1 Chen-Yu Tsai
2018-12-03  9:45   ` Jagan Teki
2019-01-24 10:16     ` Chen-Yu Tsai
2018-11-30  7:58 ` [PATCH 5/6] [DO NOT MERGE] ARM: dts: sunxi: bananapi-m2p: Add HDF5640 camera module Chen-Yu Tsai
2018-12-03  9:51   ` Jagan Teki
2018-12-03  9:54     ` Chen-Yu Tsai
2018-11-30  7:58 ` Chen-Yu Tsai [this message]
2018-11-30  8:47 ` [PATCH 0/6] media: sun6i: Separate H3 compatible from A31 Maxime Ripard
2018-12-13 22:10 ` sakari.ailus
2018-12-14  2:23   ` Chen-Yu Tsai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181130075849.16941-7-wens@csie.org \
    --to=wens@csie.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=mchehab@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=yong.deng@magewell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).