linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] media: sun6i: Separate H3 compatible from A31
@ 2018-11-30  7:58 Chen-Yu Tsai
  2018-11-30  7:58 ` [PATCH 1/6] media: dt-bindings: " Chen-Yu Tsai
                   ` (7 more replies)
  0 siblings, 8 replies; 21+ messages in thread
From: Chen-Yu Tsai @ 2018-11-30  7:58 UTC (permalink / raw)
  To: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland
  Cc: Chen-Yu Tsai, linux-media, linux-arm-kernel, devicetree, linux-kernel

The CSI (camera sensor interface) controller found on the H3 (and H5)
is a reduced version of the one found on the A31. It only has 1 channel,
instead of 4 channels supporting time-multiplexed BT.656 on the A31.
Since the H3 is a reduced version, it cannot "fallback" to a compatible
that implements more features than it supports.

This series separates support for the H3 variant from the A31 variant.

Patches 1 ~ 3 separate H3 CSI from A31 CSI in the bindings, driver, and
device tree, respectively.

Patch 4 adds a pinmux setting for the MCLK (master clock). Some camera
sensors use the master clock from the SoC instead of a standalone
crystal.

Patches 5 and 6 are examples of using a camera sensor with an SBC.
Since the modules are detachable, these changes should not be merged.
They should be implemented as overlays instead.

Please have a look.

In addition, I found that the first frame captured seems to always be
incomplete, with either parts cropped, out of position, or missing
color components.

Regards
ChenYu


Chen-Yu Tsai (6):
  media: dt-bindings: media: sun6i: Separate H3 compatible from A31
  media: sun6i: Add H3 compatible
  ARM: dts: sunxi: h3/h5: Drop A31 fallback compatible for CSI
    controller
  ARM: dts: sunxi: h3-h5: Add pinmux setting for CSI MCLK on PE1
  [DO NOT MERGE] ARM: dts: sunxi: bananapi-m2p: Add HDF5640 camera
    module
  [DO NOT MERGE] ARM: dts: sunxi: libretech-all-h3-cc: Add HDF5640
    camera module

 .../devicetree/bindings/media/sun6i-csi.txt   |  2 +-
 arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi | 87 +++++++++++++++++++
 arch/arm/boot/dts/sunxi-h3-h5.dtsi            |  8 +-
 .../boot/dts/sunxi-libretech-all-h3-cc.dtsi   | 81 +++++++++++++++++
 .../platform/sunxi/sun6i-csi/sun6i_csi.c      |  1 +
 5 files changed, 176 insertions(+), 3 deletions(-)

-- 
2.20.0.rc1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 1/6] media: dt-bindings: media: sun6i: Separate H3 compatible from A31
  2018-11-30  7:58 [PATCH 0/6] media: sun6i: Separate H3 compatible from A31 Chen-Yu Tsai
@ 2018-11-30  7:58 ` Chen-Yu Tsai
  2018-12-03  9:41   ` Jagan Teki
  2018-12-12  2:33   ` Rob Herring
  2018-11-30  7:58 ` [PATCH 2/6] media: sun6i: Add H3 compatible Chen-Yu Tsai
                   ` (6 subsequent siblings)
  7 siblings, 2 replies; 21+ messages in thread
From: Chen-Yu Tsai @ 2018-11-30  7:58 UTC (permalink / raw)
  To: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland
  Cc: Chen-Yu Tsai, linux-media, linux-arm-kernel, devicetree, linux-kernel

The CSI controller found on the H3 (and H5) is a reduced version of the
one found on the A31. It only has 1 channel, instead of 4 channels for
time-multiplexed BT.656. Since the H3 is a reduced version, it cannot
"fallback" to a compatible that implements more features than it
supports.

Split out the H3 compatible as a separate entry, with no fallback.

Fixes: b7eadaa3a02a ("media: dt-bindings: media: sun6i: Add A31 and H3
		      compatibles")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 Documentation/devicetree/bindings/media/sun6i-csi.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/media/sun6i-csi.txt b/Documentation/devicetree/bindings/media/sun6i-csi.txt
index d4ab34f2240c..cc37cf7fd051 100644
--- a/Documentation/devicetree/bindings/media/sun6i-csi.txt
+++ b/Documentation/devicetree/bindings/media/sun6i-csi.txt
@@ -6,7 +6,7 @@ Allwinner V3s SoC features a CSI module(CSI1) with parallel interface.
 Required properties:
   - compatible: value must be one of:
     * "allwinner,sun6i-a31-csi"
-    * "allwinner,sun8i-h3-csi", "allwinner,sun6i-a31-csi"
+    * "allwinner,sun8i-h3-csi"
     * "allwinner,sun8i-v3s-csi"
   - reg: base address and size of the memory-mapped region.
   - interrupts: interrupt associated to this IP
-- 
2.20.0.rc1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 2/6] media: sun6i: Add H3 compatible
  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-11-30  7:58 ` 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
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Chen-Yu Tsai @ 2018-11-30  7:58 UTC (permalink / raw)
  To: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland
  Cc: Chen-Yu Tsai, linux-media, linux-arm-kernel, devicetree, linux-kernel

The CSI controller found on the H3 (and H5) is a reduced version of the
one found on the A31. It only has 1 channel, instead of 4 channels for
time-multiplexed BT.656. Since the H3 is a reduced version, it cannot
"fallback" to a compatible that implements more features than it
supports.

Add a compatible string entry for the H3.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
index 6950585edb5a..ee882b66a5ea 100644
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
@@ -893,6 +893,7 @@ static int sun6i_csi_remove(struct platform_device *pdev)
 
 static const struct of_device_id sun6i_csi_of_match[] = {
 	{ .compatible = "allwinner,sun6i-a31-csi", },
+	{ .compatible = "allwinner,sun8i-h3-csi", },
 	{ .compatible = "allwinner,sun8i-v3s-csi", },
 	{},
 };
-- 
2.20.0.rc1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 3/6] ARM: dts: sunxi: h3/h5: Drop A31 fallback compatible for CSI controller
  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-11-30  7:58 ` [PATCH 2/6] media: sun6i: Add H3 compatible Chen-Yu Tsai
@ 2018-11-30  7:58 ` Chen-Yu Tsai
  2018-12-03  9:44   ` Jagan Teki
  2018-11-30  7:58 ` [PATCH 4/6] ARM: dts: sunxi: h3-h5: Add pinmux setting for CSI MCLK on PE1 Chen-Yu Tsai
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Chen-Yu Tsai @ 2018-11-30  7:58 UTC (permalink / raw)
  To: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland
  Cc: Chen-Yu Tsai, linux-media, linux-arm-kernel, devicetree, linux-kernel

The CSI controller found on the H3 (and H5) is a reduced version of the
one found on the A31. It only has 1 channel, instead of 4 channels for
time-multiplexed BT.656. Since the H3 is a reduced version, it cannot
"fallback" to a compatible that implements more features than it
supports.

Drop the A31 fallback compatible.

Fixes: f89120b6f554 ("ARM: dts: sun8i: Add the H3/H5 CSI controller")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sunxi-h3-h5.dtsi | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
index 0d9e9eac518c..c9c9ec71945f 100644
--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
@@ -752,8 +752,7 @@
 		};
 
 		csi: camera@1cb0000 {
-			compatible = "allwinner,sun8i-h3-csi",
-				     "allwinner,sun6i-a31-csi";
+			compatible = "allwinner,sun8i-h3-csi";
 			reg = <0x01cb0000 0x1000>;
 			interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ccu CLK_BUS_CSI>,
-- 
2.20.0.rc1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 4/6] ARM: dts: sunxi: h3-h5: Add pinmux setting for CSI MCLK on PE1
  2018-11-30  7:58 [PATCH 0/6] media: sun6i: Separate H3 compatible from A31 Chen-Yu Tsai
                   ` (2 preceding siblings ...)
  2018-11-30  7:58 ` [PATCH 3/6] ARM: dts: sunxi: h3/h5: Drop A31 fallback compatible for CSI controller Chen-Yu Tsai
@ 2018-11-30  7:58 ` Chen-Yu Tsai
  2018-12-03  9:45   ` Jagan Teki
  2018-11-30  7:58 ` [PATCH 5/6] [DO NOT MERGE] ARM: dts: sunxi: bananapi-m2p: Add HDF5640 camera module Chen-Yu Tsai
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Chen-Yu Tsai @ 2018-11-30  7:58 UTC (permalink / raw)
  To: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland
  Cc: Chen-Yu Tsai, linux-media, linux-arm-kernel, devicetree, linux-kernel

Some camera modules have the SoC feeding a master clock to the sensor
instead of having a standalone crystal. This clock signal is generated
from the clock control unit and output from the CSI MCLK function of
pin PE1.

Add a pinmux setting for it for camera sensors to reference.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sunxi-h3-h5.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
index c9c9ec71945f..b70899500825 100644
--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
@@ -400,6 +400,11 @@
 				function = "csi";
 			};
 
+			csi_mclk_pin: csi-mclk {
+				pins = "PE1";
+				function = "csi";
+			};
+
 			emac_rgmii_pins: emac0 {
 				pins = "PD0", "PD1", "PD2", "PD3", "PD4",
 				       "PD5", "PD7", "PD8", "PD9", "PD10",
-- 
2.20.0.rc1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 5/6] [DO NOT MERGE] ARM: dts: sunxi: bananapi-m2p: Add HDF5640 camera module
  2018-11-30  7:58 [PATCH 0/6] media: sun6i: Separate H3 compatible from A31 Chen-Yu Tsai
                   ` (3 preceding siblings ...)
  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-11-30  7:58 ` Chen-Yu Tsai
  2018-12-03  9:51   ` Jagan Teki
  2018-11-30  7:58 ` [PATCH 6/6] [DO NOT MERGE] ARM: dts: sunxi: libretech-all-h3-cc: " Chen-Yu Tsai
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Chen-Yu Tsai @ 2018-11-30  7:58 UTC (permalink / raw)
  To: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland
  Cc: Chen-Yu Tsai, linux-media, linux-arm-kernel, devicetree, linux-kernel

The Bananapi M2+ comes with an optional sensor based on the ov5640 from
Omnivision. Enable the support for it in the DT.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi | 87 +++++++++++++++++++
 1 file changed, 87 insertions(+)

diff --git a/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi b/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi
index b3283aeb5b7d..d97a98acf378 100644
--- a/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi
+++ b/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi
@@ -89,6 +89,42 @@
 		};
 	};
 
+	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 = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
+	};
+
+	reg_cam_dovdd: cam-dovdd {
+		compatible = "regulator-fixed";
+		regulator-name = "csi-dovdd";
+		regulator-min-microvolt = <2800000>;
+		regulator-max-microvolt = <2800000>;
+		/*
+		 * This regulator also powers the pull-ups for the I2C bus.
+		 * For some reason, if this is turned off, subsequent use
+		 * of the I2C bus, even when turned on, does not work.
+		 */
+		startup-delay-us = <200>; /* 50 us + board delays */
+		regulator-always-on;
+		enable-active-high;
+		gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
+	};
+
+	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 = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
+	};
+
 	reg_gmac_3v3: gmac-3v3 {
 		      compatible = "regulator-fixed";
 		      regulator-name = "gmac-3v3";
@@ -106,6 +142,26 @@
 	};
 };
 
+&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";
 };
@@ -149,6 +205,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";
+
+		reset-gpios = <&pio 4 14 GPIO_ACTIVE_LOW>; /* PE14 */
+		powerdown-gpios = <&pio 4 15 GPIO_ACTIVE_HIGH>; /* 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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 6/6] [DO NOT MERGE] ARM: dts: sunxi: libretech-all-h3-cc: Add HDF5640 camera module
  2018-11-30  7:58 [PATCH 0/6] media: sun6i: Separate H3 compatible from A31 Chen-Yu Tsai
                   ` (4 preceding siblings ...)
  2018-11-30  7:58 ` [PATCH 5/6] [DO NOT MERGE] ARM: dts: sunxi: bananapi-m2p: Add HDF5640 camera module Chen-Yu Tsai
@ 2018-11-30  7:58 ` Chen-Yu Tsai
  2018-11-30  8:47 ` [PATCH 0/6] media: sun6i: Separate H3 compatible from A31 Maxime Ripard
  2018-12-13 22:10 ` sakari.ailus
  7 siblings, 0 replies; 21+ messages in thread
From: Chen-Yu Tsai @ 2018-11-30  7:58 UTC (permalink / raw)
  To: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland
  Cc: Chen-Yu Tsai, linux-media, linux-arm-kernel, devicetree, linux-kernel

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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH 0/6] media: sun6i: Separate H3 compatible from A31
  2018-11-30  7:58 [PATCH 0/6] media: sun6i: Separate H3 compatible from A31 Chen-Yu Tsai
                   ` (5 preceding siblings ...)
  2018-11-30  7:58 ` [PATCH 6/6] [DO NOT MERGE] ARM: dts: sunxi: libretech-all-h3-cc: " Chen-Yu Tsai
@ 2018-11-30  8:47 ` Maxime Ripard
  2018-12-13 22:10 ` sakari.ailus
  7 siblings, 0 replies; 21+ messages in thread
From: Maxime Ripard @ 2018-11-30  8:47 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Yong Deng, Mauro Carvalho Chehab, Rob Herring, Mark Rutland,
	linux-media, linux-arm-kernel, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1331 bytes --]

On Fri, Nov 30, 2018 at 03:58:43PM +0800, Chen-Yu Tsai wrote:
> The CSI (camera sensor interface) controller found on the H3 (and H5)
> is a reduced version of the one found on the A31. It only has 1 channel,
> instead of 4 channels supporting time-multiplexed BT.656 on the A31.
> Since the H3 is a reduced version, it cannot "fallback" to a compatible
> that implements more features than it supports.
> 
> This series separates support for the H3 variant from the A31 variant.
> 
> Patches 1 ~ 3 separate H3 CSI from A31 CSI in the bindings, driver, and
> device tree, respectively.
> 
> Patch 4 adds a pinmux setting for the MCLK (master clock). Some camera
> sensors use the master clock from the SoC instead of a standalone
> crystal.
> 
> Patches 5 and 6 are examples of using a camera sensor with an SBC.
> Since the modules are detachable, these changes should not be merged.
> They should be implemented as overlays instead.
> 
> Please have a look.
> 
> In addition, I found that the first frame captured seems to always be
> incomplete, with either parts cropped, out of position, or missing
> color components.

For the first 4 patches,
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>

Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 1/6] media: dt-bindings: media: sun6i: Separate H3 compatible from A31
  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-12  2:33   ` Rob Herring
  1 sibling, 1 reply; 21+ messages in thread
From: Jagan Teki @ 2018-12-03  9:41 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland, linux-media, linux-arm-kernel, devicetree,
	linux-kernel

On Fri, Nov 30, 2018 at 1:29 PM Chen-Yu Tsai <wens@csie.org> wrote:
>
> The CSI controller found on the H3 (and H5) is a reduced version of the
> one found on the A31. It only has 1 channel, instead of 4 channels for
> time-multiplexed BT.656. Since the H3 is a reduced version, it cannot
> "fallback" to a compatible that implements more features than it
> supports.
>
> Split out the H3 compatible as a separate entry, with no fallback.
>
> Fixes: b7eadaa3a02a ("media: dt-bindings: media: sun6i: Add A31 and H3
>                       compatibles")
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

"media" text appear two times on commit head.

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 2/6] media: sun6i: Add H3 compatible
  2018-11-30  7:58 ` [PATCH 2/6] media: sun6i: Add H3 compatible Chen-Yu Tsai
@ 2018-12-03  9:42   ` Jagan Teki
  0 siblings, 0 replies; 21+ messages in thread
From: Jagan Teki @ 2018-12-03  9:42 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland, linux-media, linux-arm-kernel, devicetree,
	linux-kernel

On Fri, Nov 30, 2018 at 1:29 PM Chen-Yu Tsai <wens@csie.org> wrote:
>
> The CSI controller found on the H3 (and H5) is a reduced version of the
> one found on the A31. It only has 1 channel, instead of 4 channels for
> time-multiplexed BT.656. Since the H3 is a reduced version, it cannot
> "fallback" to a compatible that implements more features than it
> supports.
>
> Add a compatible string entry for the H3.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/6] ARM: dts: sunxi: h3/h5: Drop A31 fallback compatible for CSI controller
  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
  0 siblings, 1 reply; 21+ messages in thread
From: Jagan Teki @ 2018-12-03  9:44 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland, linux-media, linux-arm-kernel, devicetree,
	linux-kernel

On Fri, Nov 30, 2018 at 1:29 PM Chen-Yu Tsai <wens@csie.org> wrote:
>
> The CSI controller found on the H3 (and H5) is a reduced version of the
> one found on the A31. It only has 1 channel, instead of 4 channels for
> time-multiplexed BT.656. Since the H3 is a reduced version, it cannot
> "fallback" to a compatible that implements more features than it
> supports.
>
> Drop the A31 fallback compatible.
>
> Fixes: f89120b6f554 ("ARM: dts: sun8i: Add the H3/H5 CSI controller")
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 4/6] ARM: dts: sunxi: h3-h5: Add pinmux setting for CSI MCLK on PE1
  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
  0 siblings, 1 reply; 21+ messages in thread
From: Jagan Teki @ 2018-12-03  9:45 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland, linux-media, linux-arm-kernel, devicetree,
	linux-kernel

On Fri, Nov 30, 2018 at 1:28 PM Chen-Yu Tsai <wens@csie.org> wrote:
>
> Some camera modules have the SoC feeding a master clock to the sensor
> instead of having a standalone crystal. This clock signal is generated
> from the clock control unit and output from the CSI MCLK function of
> pin PE1.
>
> Add a pinmux setting for it for camera sensors to reference.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---

On Fri, Nov 30, 2018 at 1:29 PM Chen-Yu Tsai <wens@csie.org> wrote:
>
> The CSI controller found on the H3 (and H5) is a reduced version of the
> one found on the A31. It only has 1 channel, instead of 4 channels for
> time-multiplexed BT.656. Since the H3 is a reduced version, it cannot
> "fallback" to a compatible that implements more features than it
> supports.
>
> Drop the A31 fallback compatible.
>
> Fixes: f89120b6f554 ("ARM: dts: sun8i: Add the H3/H5 CSI controller")
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 1/6] media: dt-bindings: media: sun6i: Separate H3 compatible from A31
  2018-12-03  9:41   ` Jagan Teki
@ 2018-12-03  9:48     ` Chen-Yu Tsai
  2018-12-04 13:13       ` sakari.ailus
  0 siblings, 1 reply; 21+ messages in thread
From: Chen-Yu Tsai @ 2018-12-03  9:48 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland, Linux Media Mailing List, linux-arm-kernel,
	devicetree, linux-kernel

On Mon, Dec 3, 2018 at 5:42 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Fri, Nov 30, 2018 at 1:29 PM Chen-Yu Tsai <wens@csie.org> wrote:
> >
> > The CSI controller found on the H3 (and H5) is a reduced version of the
> > one found on the A31. It only has 1 channel, instead of 4 channels for
> > time-multiplexed BT.656. Since the H3 is a reduced version, it cannot
> > "fallback" to a compatible that implements more features than it
> > supports.
> >
> > Split out the H3 compatible as a separate entry, with no fallback.
> >
> > Fixes: b7eadaa3a02a ("media: dt-bindings: media: sun6i: Add A31 and H3
> >                       compatibles")
> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>
> "media" text appear two times on commit head.

Just following what previous commits did. :)

> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

BTW, I know you've been trying to get CSI to work on the A64.
I have it working for the Bananapi-M64. The CSI SCLK needs to
be lowered to 300 MHz or the image gets corrupted.

ChenYu

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 5/6] [DO NOT MERGE] ARM: dts: sunxi: bananapi-m2p: Add HDF5640 camera module
  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
  0 siblings, 1 reply; 21+ messages in thread
From: Jagan Teki @ 2018-12-03  9:51 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland, linux-media, linux-arm-kernel, devicetree,
	linux-kernel

On Fri, Nov 30, 2018 at 1:29 PM Chen-Yu Tsai <wens@csie.org> wrote:
>
> The Bananapi M2+ comes with an optional sensor based on the ov5640 from
> Omnivision. Enable the support for it in the DT.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi | 87 +++++++++++++++++++
>  1 file changed, 87 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi b/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi
> index b3283aeb5b7d..d97a98acf378 100644
> --- a/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi
> +++ b/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi
> @@ -89,6 +89,42 @@
>                 };
>         };
>
> +       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 = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
> +       };
> +
> +       reg_cam_dovdd: cam-dovdd {
> +               compatible = "regulator-fixed";
> +               regulator-name = "csi-dovdd";
> +               regulator-min-microvolt = <2800000>;
> +               regulator-max-microvolt = <2800000>;
> +               /*
> +                * This regulator also powers the pull-ups for the I2C bus.
> +                * For some reason, if this is turned off, subsequent use
> +                * of the I2C bus, even when turned on, does not work.
> +                */
> +               startup-delay-us = <200>; /* 50 us + board delays */
> +               regulator-always-on;
> +               enable-active-high;
> +               gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
> +       };
> +
> +       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 = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
> +       };
> +
>         reg_gmac_3v3: gmac-3v3 {
>                       compatible = "regulator-fixed";
>                       regulator-name = "gmac-3v3";
> @@ -106,6 +142,26 @@
>         };
>  };
>
> +&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>;

If I'm not wrong, the data-shift is not available in sun6i at-least in
conf register.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 5/6] [DO NOT MERGE] ARM: dts: sunxi: bananapi-m2p: Add HDF5640 camera module
  2018-12-03  9:51   ` Jagan Teki
@ 2018-12-03  9:54     ` Chen-Yu Tsai
  0 siblings, 0 replies; 21+ messages in thread
From: Chen-Yu Tsai @ 2018-12-03  9:54 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland, Linux Media Mailing List, linux-arm-kernel,
	devicetree, linux-kernel

On Mon, Dec 3, 2018 at 5:52 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Fri, Nov 30, 2018 at 1:29 PM Chen-Yu Tsai <wens@csie.org> wrote:
> >
> > The Bananapi M2+ comes with an optional sensor based on the ov5640 from
> > Omnivision. Enable the support for it in the DT.
> >
> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> > ---
> >  arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi | 87 +++++++++++++++++++
> >  1 file changed, 87 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi b/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi
> > index b3283aeb5b7d..d97a98acf378 100644
> > --- a/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi
> > +++ b/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi
> > @@ -89,6 +89,42 @@
> >                 };
> >         };
> >
> > +       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 = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
> > +       };
> > +
> > +       reg_cam_dovdd: cam-dovdd {
> > +               compatible = "regulator-fixed";
> > +               regulator-name = "csi-dovdd";
> > +               regulator-min-microvolt = <2800000>;
> > +               regulator-max-microvolt = <2800000>;
> > +               /*
> > +                * This regulator also powers the pull-ups for the I2C bus.
> > +                * For some reason, if this is turned off, subsequent use
> > +                * of the I2C bus, even when turned on, does not work.
> > +                */
> > +               startup-delay-us = <200>; /* 50 us + board delays */
> > +               regulator-always-on;
> > +               enable-active-high;
> > +               gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
> > +       };
> > +
> > +       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 = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
> > +       };
> > +
> >         reg_gmac_3v3: gmac-3v3 {
> >                       compatible = "regulator-fixed";
> >                       regulator-name = "gmac-3v3";
> > @@ -106,6 +142,26 @@
> >         };
> >  };
> >
> > +&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>;
>
> If I'm not wrong, the data-shift is not available in sun6i at-least in
> conf register.

Indeed. Seems only a few drivers actually take this into account. Since
this is just an example, I'm not going to respin it.

ChenYu

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 1/6] media: dt-bindings: media: sun6i: Separate H3 compatible from A31
  2018-12-03  9:48     ` Chen-Yu Tsai
@ 2018-12-04 13:13       ` sakari.ailus
  0 siblings, 0 replies; 21+ messages in thread
From: sakari.ailus @ 2018-12-04 13:13 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Jagan Teki, Yong Deng, Mauro Carvalho Chehab, Maxime Ripard,
	Rob Herring, Mark Rutland, Linux Media Mailing List,
	linux-arm-kernel, devicetree, linux-kernel

Hi Chen-Yu,

On Mon, Dec 03, 2018 at 05:48:31PM +0800, Chen-Yu Tsai wrote:
> On Mon, Dec 3, 2018 at 5:42 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > On Fri, Nov 30, 2018 at 1:29 PM Chen-Yu Tsai <wens@csie.org> wrote:
> > >
> > > The CSI controller found on the H3 (and H5) is a reduced version of the
> > > one found on the A31. It only has 1 channel, instead of 4 channels for
> > > time-multiplexed BT.656. Since the H3 is a reduced version, it cannot
> > > "fallback" to a compatible that implements more features than it
> > > supports.
> > >
> > > Split out the H3 compatible as a separate entry, with no fallback.
> > >
> > > Fixes: b7eadaa3a02a ("media: dt-bindings: media: sun6i: Add A31 and H3
> > >                       compatibles")
> > > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> >
> > "media" text appear two times on commit head.
> 
> Just following what previous commits did. :)

I understand Mauro has a  script prefixes everything going through the
media tree with "media: " unless it's already there. I'd drop the latter,
but perhaps elaborate a bit this is about CSI. Fine details... I think it's
fine as-is for now.

> 
> > Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
> 
> BTW, I know you've been trying to get CSI to work on the A64.
> I have it working for the Bananapi-M64. The CSI SCLK needs to
> be lowered to 300 MHz or the image gets corrupted.
> 
> ChenYu

-- 
Sakari Ailus

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 1/6] media: dt-bindings: media: sun6i: Separate H3 compatible from A31
  2018-11-30  7:58 ` [PATCH 1/6] media: dt-bindings: " Chen-Yu Tsai
  2018-12-03  9:41   ` Jagan Teki
@ 2018-12-12  2:33   ` Rob Herring
  1 sibling, 0 replies; 21+ messages in thread
From: Rob Herring @ 2018-12-12  2:33 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Mark Rutland,
	Chen-Yu Tsai, linux-media, linux-arm-kernel, devicetree,
	linux-kernel

On Fri, 30 Nov 2018 15:58:44 +0800, Chen-Yu Tsai wrote:
> The CSI controller found on the H3 (and H5) is a reduced version of the
> one found on the A31. It only has 1 channel, instead of 4 channels for
> time-multiplexed BT.656. Since the H3 is a reduced version, it cannot
> "fallback" to a compatible that implements more features than it
> supports.
> 
> Split out the H3 compatible as a separate entry, with no fallback.
> 
> Fixes: b7eadaa3a02a ("media: dt-bindings: media: sun6i: Add A31 and H3
> 		      compatibles")
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  Documentation/devicetree/bindings/media/sun6i-csi.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 0/6] media: sun6i: Separate H3 compatible from A31
  2018-11-30  7:58 [PATCH 0/6] media: sun6i: Separate H3 compatible from A31 Chen-Yu Tsai
                   ` (6 preceding siblings ...)
  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
  7 siblings, 1 reply; 21+ messages in thread
From: sakari.ailus @ 2018-12-13 22:10 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland, linux-media, linux-arm-kernel, devicetree,
	linux-kernel

Hi Chen-Yu,

On Fri, Nov 30, 2018 at 03:58:43PM +0800, Chen-Yu Tsai wrote:
> The CSI (camera sensor interface) controller found on the H3 (and H5)
> is a reduced version of the one found on the A31. It only has 1 channel,
> instead of 4 channels supporting time-multiplexed BT.656 on the A31.
> Since the H3 is a reduced version, it cannot "fallback" to a compatible
> that implements more features than it supports.
> 
> This series separates support for the H3 variant from the A31 variant.
> 
> Patches 1 ~ 3 separate H3 CSI from A31 CSI in the bindings, driver, and
> device tree, respectively.
> 
> Patch 4 adds a pinmux setting for the MCLK (master clock). Some camera
> sensors use the master clock from the SoC instead of a standalone
> crystal.

I've picked patches 1 and 2, but I presume patches 3 and 4 would go through
another tree. Is that right?

> 
> Patches 5 and 6 are examples of using a camera sensor with an SBC.
> Since the modules are detachable, these changes should not be merged.
> They should be implemented as overlays instead.
> 
> Please have a look.
> 
> In addition, I found that the first frame captured seems to always be
> incomplete, with either parts cropped, out of position, or missing
> color components.


-- 
Regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 0/6] media: sun6i: Separate H3 compatible from A31
  2018-12-13 22:10 ` sakari.ailus
@ 2018-12-14  2:23   ` Chen-Yu Tsai
  0 siblings, 0 replies; 21+ messages in thread
From: Chen-Yu Tsai @ 2018-12-14  2:23 UTC (permalink / raw)
  To: sakari.ailus
  Cc: Yong Deng, Mauro Carvalho Chehab, Maxime Ripard, Rob Herring,
	Mark Rutland, Linux Media Mailing List, linux-arm-kernel,
	devicetree, linux-kernel

On Fri, Dec 14, 2018 at 6:10 AM <sakari.ailus@iki.fi> wrote:
>
> Hi Chen-Yu,
>
> On Fri, Nov 30, 2018 at 03:58:43PM +0800, Chen-Yu Tsai wrote:
> > The CSI (camera sensor interface) controller found on the H3 (and H5)
> > is a reduced version of the one found on the A31. It only has 1 channel,
> > instead of 4 channels supporting time-multiplexed BT.656 on the A31.
> > Since the H3 is a reduced version, it cannot "fallback" to a compatible
> > that implements more features than it supports.
> >
> > This series separates support for the H3 variant from the A31 variant.
> >
> > Patches 1 ~ 3 separate H3 CSI from A31 CSI in the bindings, driver, and
> > device tree, respectively.
> >
> > Patch 4 adds a pinmux setting for the MCLK (master clock). Some camera
> > sensors use the master clock from the SoC instead of a standalone
> > crystal.
>
> I've picked patches 1 and 2, but I presume patches 3 and 4 would go through
> another tree. Is that right?

We'll merge patch 3 through the sunxi tree, probably as a fix for 4.21-rc.
Maxime has said that pinmux settings won't be merged unless there are actual
users in tree, so patch 4 won't be merged for now.

Thanks!
ChenYu

>
> >
> > Patches 5 and 6 are examples of using a camera sensor with an SBC.
> > Since the modules are detachable, these changes should not be merged.
> > They should be implemented as overlays instead.
> >
> > Please have a look.
> >
> > In addition, I found that the first frame captured seems to always be
> > incomplete, with either parts cropped, out of position, or missing
> > color components.
>
>
> --
> Regards,
>
> Sakari Ailus

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/6] ARM: dts: sunxi: h3/h5: Drop A31 fallback compatible for CSI controller
  2018-12-03  9:44   ` Jagan Teki
@ 2019-01-24 10:15     ` Chen-Yu Tsai
  0 siblings, 0 replies; 21+ messages in thread
From: Chen-Yu Tsai @ 2019-01-24 10:15 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Jagan Teki, Yong Deng, Mauro Carvalho Chehab, Rob Herring,
	Mark Rutland, linux-media, linux-arm-kernel, devicetree,
	linux-kernel, Chen-Yu Tsai

On Mon, Dec 3, 2018 at 5:44 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Fri, Nov 30, 2018 at 1:29 PM Chen-Yu Tsai <wens@csie.org> wrote:
> >
> > The CSI controller found on the H3 (and H5) is a reduced version of the
> > one found on the A31. It only has 1 channel, instead of 4 channels for
> > time-multiplexed BT.656. Since the H3 is a reduced version, it cannot
> > "fallback" to a compatible that implements more features than it
> > supports.
> >
> > Drop the A31 fallback compatible.
> >
> > Fixes: f89120b6f554 ("ARM: dts: sun8i: Add the H3/H5 CSI controller")
> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> > ---
>
> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

Merged for 5.1, as the accompanying driver changes were also merged for 5.1

ChenYu

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 4/6] ARM: dts: sunxi: h3-h5: Add pinmux setting for CSI MCLK on PE1
  2018-12-03  9:45   ` Jagan Teki
@ 2019-01-24 10:16     ` Chen-Yu Tsai
  0 siblings, 0 replies; 21+ messages in thread
From: Chen-Yu Tsai @ 2019-01-24 10:16 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Yong Deng, Jagan Teki, Mauro Carvalho Chehab, Rob Herring,
	Mark Rutland, linux-media, linux-arm-kernel, devicetree,
	linux-kernel, Chen-Yu Tsai

On Mon, Dec 3, 2018 at 5:46 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Fri, Nov 30, 2018 at 1:28 PM Chen-Yu Tsai <wens@csie.org> wrote:
> >
> > Some camera modules have the SoC feeding a master clock to the sensor
> > instead of having a standalone crystal. This clock signal is generated
> > from the clock control unit and output from the CSI MCLK function of
> > pin PE1.
> >
> > Add a pinmux setting for it for camera sensors to reference.
> >
> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> > ---
>
> On Fri, Nov 30, 2018 at 1:29 PM Chen-Yu Tsai <wens@csie.org> wrote:
> >
> > The CSI controller found on the H3 (and H5) is a reduced version of the
> > one found on the A31. It only has 1 channel, instead of 4 channels for
> > time-multiplexed BT.656. Since the H3 is a reduced version, it cannot
> > "fallback" to a compatible that implements more features than it
> > supports.
> >
> > Drop the A31 fallback compatible.
> >
> > Fixes: f89120b6f554 ("ARM: dts: sun8i: Add the H3/H5 CSI controller")
> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> > ---
>
> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

Not merging this one, as there are no boards in tree that directly use this.

ChenYu

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2019-01-24 10:17 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 6/6] [DO NOT MERGE] ARM: dts: sunxi: libretech-all-h3-cc: " Chen-Yu Tsai
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

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).