Skip to contentSkip to conversation

ARM: davinci: add vpif display support

PATCH Applied Bartosz Golaszewski 6 participants 35 messages Feb 7, 2017 – Mar 9, 2017

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover ARM: davinci: add vpif display support

The following series adds support for v4l2 display on da850-evm with a UI board in device tree boot mode.

Patches 1/10 - 5/10 deal with the device tree: we fix whitespace errors in dts files and bindings, extend the example and the dts for da850-evm with the output port and address the pinmuxing.

Patch 6/10 enables the relevant modules in the defconfig file.

Patches 7/10 and 8/10 fix two already existing bugs encountered during development.

Patch 9/10 make it possible to use a different i2c adapter in the vpif display driver.

The last patch adds the pdata quirks necessary to enable v4l2 display.

Tested with a modified version of yavta[1] as gstreamer support for v4l2 seems to be broken and results in picture artifacts.

[1] https://github.com/brgl/yavta davinci/vpif-display

Bartosz Golaszewski (10):
media: dt-bindings: vpif: fix whitespace errors
ARM: dts: da850-evm: fix whitespace errors
media: dt-bindings: vpif: extend the example with an output port
ARM: dts: da850-evm: add the output port to the vpif node
ARM: dts: da850: add vpif video display pins
ARM: davinci_all_defconfig: enable VPIF display modules
ARM: davinci: fix a whitespace error
ARM: davinci: fix the DT boot on da850-evm
media: vpif: use a configurable i2c_adapter_id for vpif display
ARM: davinci: add pdata-quirks for da850-evm vpif display

 .../devicetree/bindings/media/ti,da850-vpif.txt    | 45 ++++++++---
 arch/arm/boot/dts/da850-evm.dts                    | 26 +++---
 arch/arm/boot/dts/da850.dtsi                       | 25 +++++-
 arch/arm/configs/davinci_all_defconfig             |  2 +
 arch/arm/mach-davinci/board-da850-evm.c            |  1 +
 arch/arm/mach-davinci/pdata-quirks.c               | 92 ++++++++++++++++++++--
 drivers/media/platform/davinci/vpif_display.c      |  2 +-
 include/media/davinci/vpif_types.h                 |  1 +
 8 files changed, 164 insertions(+), 30 deletions(-)
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/10 media: dt-bindings: vpif: fix whitespace errors

---
 Documentation/devicetree/bindings/media/ti,da850-vpif.txt | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +6 -6
index 6d25d7f..9c7510b 100644
@@ -30,15 +30,15 @@ I2C-connected TVP5147 decoder:
 
 		port {
 			vpif_ch0: endpoint at 0 {
-				  reg = <0>;
-				  bus-width = <8>;
-				  remote-endpoint = <&composite>;
+				reg = <0>;
+				bus-width = <8>;
+				remote-endpoint = <&composite>;
 			};
 
 			vpif_ch1: endpoint at 1 {
-				  reg = <1>;
-				  bus-width = <8>;
-				  data-shift = <8>;
+				reg = <1>;
+				bus-width = <8>;
+				data-shift = <8>;
 			};
 		};
 	};
Signature · 1 line
2.9.3
#3 lore raw

PATCH 2/10 ARM: dts: da850-evm: fix whitespace errors

In reply to Bartosz Golaszewski
---
 arch/arm/boot/dts/da850-evm.dts | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/da850-evm.dts +5 -5
index c970b6e..94938a3 100644
@@ -301,14 +301,14 @@
 	/* VPIF capture port */
 	port {
 		vpif_ch0: endpoint at 0 {
-			  reg = <0>;
-			  bus-width = <8>;
+			reg = <0>;
+			bus-width = <8>;
 		};
 
 		vpif_ch1: endpoint at 1 {
-			  reg = <1>;
-			  bus-width = <8>;
-			  data-shift = <8>;
+			reg = <1>;
+			bus-width = <8>;
+			data-shift = <8>;
 		};
 	};
 };
Signature · 1 line
2.9.3
Acked-by on v1 2/10
#4 lore raw

Re: [PATCH 02/10] ARM: dts: da850-evm: fix whitespace errors

Quoted 1 line · Bartosz Golaszewski
Quoted 28 lines
---
 arch/arm/boot/dts/da850-evm.dts | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/da850-evm.dts +5 -5
index c970b6e..94938a3 100644
@@ -301,14 +301,14 @@
 	/* VPIF capture port */
 	port {
 		vpif_ch0: endpoint at 0 {
-			  reg = <0>;
-			  bus-width = <8>;
+			reg = <0>;
+			bus-width = <8>;
 		};
 
 		vpif_ch1: endpoint at 1 {
-			  reg = <1>;
-			  bus-width = <8>;
-			  data-shift = <8>;
+			reg = <1>;
+			bus-width = <8>;
+			data-shift = <8>;
 		};
 	};
 };
Quoted 62 lines · Bartosz Golaszewski

Extend the vpif node with an output port with a single channel.

NOTE: this is still just hardware description - the actual driver is registered using pdata-quirks.

---
 arch/arm/boot/dts/da850-evm.dts | 14 +++++++++++---
 arch/arm/boot/dts/da850.dtsi    |  8 +++++++-
 2 files changed, 18 insertions(+), 4 deletions(-)
arch/arm/boot/dts/da850-evm.dts +11 -3
index 94938a3..3d6dd66 100644
@@ -299,16 +299,24 @@
 	status = "okay";
 
 	/* VPIF capture port */
-	port {
-		vpif_ch0: endpoint at 0 {
+	port at 0 {
+		vpif_input_ch0: endpoint at 0 {
 			reg = <0>;
 			bus-width = <8>;
 		};
 
-		vpif_ch1: endpoint at 1 {
+		vpif_input_ch1: endpoint at 1 {
 			reg = <1>;
 			bus-width = <8>;
 			data-shift = <8>;
 		};
 	};
+
+	/* VPIF display port */
+	port at 1 {
+		vpif_output_ch0: endpoint at 0 {
+			reg = <0>;
+			bus-width = <8>;
+		};
+	};
 };
arch/arm/boot/dts/da850.dtsi +7 -1
index 69ec5e7..768a58c 100644
@@ -494,7 +494,13 @@
 			status = "disabled";
 
 			/* VPIF capture port */
-			port {
+			port at 0 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+
+			/* VPIF display port */
+			port at 1 {
 				#address-cells = <1>;
 				#size-cells = <0>;
 			};
Quoted 20 lines · Bartosz Golaszewski

There's a stray tab in da850_vpif_legacy_init(). Remove it.

---
 arch/arm/mach-davinci/pdata-quirks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-davinci/pdata-quirks.c +1 -1
index a186513..94948c1 100644
@@ -111,7 +111,7 @@ static struct vpif_capture_config da850_vpif_capture_config = {
 static void __init da850_vpif_legacy_init(void)
 {
 	int ret;
-	
+
 	/* LCDK doesn't have the 2nd TVP514x on CH1 */
 	if (of_machine_is_compatible("ti,da850-lcdk"))
 		da850_vpif_capture_config.subdev_count = 1;
#5 lore raw

Re: [PATCH 02/10] ARM: dts: da850-evm: fix whitespace errors

In reply to Bartosz Golaszewski
Quoted 1 line · Bartosz Golaszewski

I'll fold this one into the original since it's not yet merged.

Kevin

Quoted 28 lines
---
 arch/arm/boot/dts/da850-evm.dts | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/da850-evm.dts +5 -5
index c970b6e..94938a3 100644
@@ -301,14 +301,14 @@
 	/* VPIF capture port */
 	port {
 		vpif_ch0: endpoint at 0 {
-			  reg = <0>;
-			  bus-width = <8>;
+			reg = <0>;
+			bus-width = <8>;
 		};
 
 		vpif_ch1: endpoint at 1 {
-			  reg = <1>;
-			  bus-width = <8>;
-			  data-shift = <8>;
+			reg = <1>;
+			bus-width = <8>;
+			data-shift = <8>;
 		};
 	};
 };
#6 lore raw

Re: [PATCH 02/10] ARM: dts: da850-evm: fix whitespace errors

Quoted 5 lines · Kevin Hilman
Quoted 1 line · Bartosz Golaszewski

I'll fold this one into the original since it's not yet merged.

Oops, Sekhar has already merged this one to his v4.11/dt branch, so he can apply it (or fold it in.)

Kevin

#7 lore raw

Re: [PATCH 02/10] ARM: dts: da850-evm: fix whitespace errors

Quoted 10 lines · Kevin Hilman
Quoted 5 lines · Kevin Hilman
Quoted 1 line · Bartosz Golaszewski

I'll fold this one into the original since it's not yet merged.

Oops, Sekhar has already merged this one to his v4.11/dt branch, so he can apply it (or fold it in.)

Alright, I will apply this.

Bartosz, for future, please add a commit description for trivial patches too. Even if its more or less just a rewording of subject line.

Thanks,
Sekhar

#8 lore raw

PATCH 3/10 media: dt-bindings: vpif: extend the example with an output port

In reply to Bartosz Golaszewski

This makes the example more or less correspond with the da850-evm hardware setup.

---
 .../devicetree/bindings/media/ti,da850-vpif.txt    | 35 ++++++++++++++++++----
 1 file changed, 29 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +29 -6
index 9c7510b..543f6f3 100644
@@ -28,19 +28,27 @@ I2C-connected TVP5147 decoder:
 		reg = <0x217000 0x1000>;
 		interrupts = <92>;
 
-		port {
-			vpif_ch0: endpoint at 0 {
+		port at 0 {
+			vpif_input_ch0: endpoint at 0 {
 				reg = <0>;
 				bus-width = <8>;
-				remote-endpoint = <&composite>;
+				remote-endpoint = <&composite_in>;
 			};
 
-			vpif_ch1: endpoint at 1 {
+			vpif_input_ch1: endpoint at 1 {
 				reg = <1>;
 				bus-width = <8>;
 				data-shift = <8>;
 			};
 		};
+
+		port at 1 {
+			vpif_output_ch0: endpoint at 0 {
+				reg = <0>;
+				bus-width = <8>;
+				remote-endpoint = <&composite_out>;
+			};
+		};
 	};
 
 [ ... ]
@@ -53,13 +61,28 @@ I2C-connected TVP5147 decoder:
 		status = "okay";
 
 		port {
-			composite: endpoint {
+			composite_in: endpoint {
 				hsync-active = <1>;
 				vsync-active = <1>;
 				pclk-sample = <0>;
 
 				/* VPIF channel 0 (lower 8-bits) */
-				remote-endpoint = <&vpif_ch0>;
+				remote-endpoint = <&vpif_input_ch0>;
+				bus-width = <8>;
+			};
+		};
+	};
+
+	adv7343 at 2a {
+		compatible = "adi,adv7343";
+		reg = <0x2a>;
+
+		port {
+			composite_out: endpoint {
+				adi,dac-enable = <1 1 1>;
+				adi,sd-dac-enable = <1>;
+
+				remote-endpoint = <&vpif_output_ch0>;
 				bus-width = <8>;
 			};
 		};
Signature · 1 line
2.9.3
maintainer Acked-by on v1 3/10
#9 lore raw

Re: [PATCH 03/10] media: dt-bindings: vpif: extend the example with an output port

Quoted 7 lines · Bartosz Golaszewski

This makes the example more or less correspond with the da850-evm hardware setup.

---
 .../devicetree/bindings/media/ti,da850-vpif.txt    | 35 ++++++++++++++++++----
 1 file changed, 29 insertions(+), 6 deletions(-)
maintainer
#10 lore raw

Re: [PATCH 03/10] media: dt-bindings: vpif: extend the example with an output port

In reply to Bartosz Golaszewski
Quoted 7 lines · Bartosz Golaszewski

This makes the example more or less correspond with the da850-evm hardware setup.

---
 .../devicetree/bindings/media/ti,da850-vpif.txt    | 35 ++++++++++++++++++----
 1 file changed, 29 insertions(+), 6 deletions(-)

Spoke too soon...

Quoted 18 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +3 -3
index 9c7510b..543f6f3 100644
@@ -28,19 +28,27 @@ I2C-connected TVP5147 decoder:
 		reg = <0x217000 0x1000>;
 		interrupts = <92>;
 
-		port {
-			vpif_ch0: endpoint at 0 {
+		port at 0 {
+			vpif_input_ch0: endpoint at 0 {
 				reg = <0>;
 				bus-width = <8>;
-				remote-endpoint = <&composite>;
+				remote-endpoint = <&composite_in>;
 			};

Documentation/devicetree/bindings/media/ti,da850-vpif.txt I2C-connected TVP5147 decoder: · line 45

Quoted 10 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +3 -1
 
-			vpif_ch1: endpoint at 1 {
+			vpif_input_ch1: endpoint at 1 {
 				reg = <1>;
 				bus-width = <8>;
 				data-shift = <8>;
 			};
 		};
+
+		port at 1 {

The binding doc says nothing about supporting a 2nd port.

Documentation/devicetree/bindings/media/ti,da850-vpif.txt I2C-connected TVP5147 decoder: · line 47

Quoted 2 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +2 -0
+			vpif_output_ch0: endpoint at 0 {
+				reg = <0>;

Don't need reg here.

Quoted 5 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +4 -0
+				bus-width = <8>;
+				remote-endpoint = <&composite_out>;
+			};
+		};
 	};
#11 lore raw

Re: [PATCH 03/10] media: dt-bindings: vpif: extend the example with an output port

Hi Rob,

Quoted 43 lines · On Wednesday 15 Feb 2017 16:08:22 Rob Herring wrote:
Quoted 8 lines · Bartosz Golaszewski

This makes the example more or less correspond with the da850-evm hardware setup.

---

 .../devicetree/bindings/media/ti,da850-vpif.txt    | 35 +++++++++++++----
 1 file changed, 29 insertions(+), 6 deletions(-)

Spoke too soon...

Quoted 18 lines
(quoted diff) +0 -0

b/Documentation/devicetree/bindings/media/ti,da850-vpif.txt index 9c7510b..543f6f3 100644

Documentation/devicetree/bindings/media/ti,da850-vpif.txt +3 -3
@@ -28,19 +28,27 @@ I2C-connected TVP5147 decoder:
 		reg = <0x217000 0x1000>;
 		interrupts = <92>;
 
-		port {
-			vpif_ch0: endpoint@0 {
+		port@0 {
+			vpif_input_ch0: endpoint@0 {
 				reg = <0>;
 				bus-width = <8>;
-				remote-endpoint = <&composite>;
+				remote-endpoint = <&composite_in>;
 			};

Documentation/devicetree/bindings/media/ti,da850-vpif.txt I2C-connected TVP5147 decoder: · line 45

Quoted 10 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +3 -1
 
-			vpif_ch1: endpoint@1 {
+			vpif_input_ch1: endpoint@1 {
 				reg = <1>;
 				bus-width = <8>;
 				data-shift = <8>;
 			};
 		};
+
+		port@1 {

The binding doc says nothing about supporting a 2nd port.

Quoted 4 lines

Documentation/devicetree/bindings/media/ti,da850-vpif.txt I2C-connected TVP5147 decoder: · line 47

Quoted 2 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +2 -0
+			vpif_output_ch0: endpoint@0 {
+				reg = <0>;

Don't need reg here.

And the node should then be named endpoint, not endpoint@0.

Quoted 5 lines
Quoted 5 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +4 -0
+				bus-width = <8>;
+				remote-endpoint = <&composite_out>;
+			};
+		};
 	};
Signature · 3 lines
Regards,

Laurent Pinchart
#12 lore raw

Re: [PATCH 03/10] media: dt-bindings: vpif: extend the example with an output port

In reply to Rob Herring

2017-02-15 23:08 GMT+01:00 Rob Herring <[email protected]>:

Quoted 30 lines · Bartosz Golaszewski
Quoted 7 lines

This makes the example more or less correspond with the da850-evm hardware setup.

---
 .../devicetree/bindings/media/ti,da850-vpif.txt    | 35 ++++++++++++++++++----
 1 file changed, 29 insertions(+), 6 deletions(-)

Spoke too soon...

Quoted 19 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +3 -3
index 9c7510b..543f6f3 100644
@@ -28,19 +28,27 @@ I2C-connected TVP5147 decoder:
              reg = <0x217000 0x1000>;
              interrupts = <92>;
 
-             port {
-                     vpif_ch0: endpoint at 0 {
+             port at 0 {
+                     vpif_input_ch0: endpoint at 0 {
                              reg = <0>;
                              bus-width = <8>;
-                             remote-endpoint = <&composite>;
+                             remote-endpoint = <&composite_in>;
                      };
 
Quoted 12 lines

Documentation/devicetree/bindings/media/ti,da850-vpif.txt I2C-connected TVP5147 decoder: · line 45

Quoted 9 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +3 -1
-                     vpif_ch1: endpoint at 1 {
+                     vpif_input_ch1: endpoint at 1 {
                              reg = <1>;
                              bus-width = <8>;
                              data-shift = <8>;
                      };
              };
+
+             port at 1 {

The binding doc says nothing about supporting a 2nd port.

I assumed that "It should contain at least one port child node" means there can be more than one.

Thanks,
Bartosz

Quoted 11 lines

Documentation/devicetree/bindings/media/ti,da850-vpif.txt I2C-connected TVP5147 decoder: · line 47

Quoted 3 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +2 -0
+                     vpif_output_ch0: endpoint at 0 {
+                             reg = <0>;

Don't need reg here.

Quoted 5 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +4 -0
+                             bus-width = <8>;
+                             remote-endpoint = <&composite_out>;
+                     };
+             };
      };
#13 lore raw

PATCH 4/10 ARM: dts: da850-evm: add the output port to the vpif node

In reply to Bartosz Golaszewski

Extend the vpif node with an output port with a single channel.

NOTE: this is still just hardware description - the actual driver is registered using pdata-quirks.

---
 arch/arm/boot/dts/da850-evm.dts | 14 +++++++++++---
 arch/arm/boot/dts/da850.dtsi    |  8 +++++++-
 2 files changed, 18 insertions(+), 4 deletions(-)
arch/arm/boot/dts/da850-evm.dts +11 -3
index 94938a3..3d6dd66 100644
@@ -299,16 +299,24 @@
 	status = "okay";
 
 	/* VPIF capture port */
-	port {
-		vpif_ch0: endpoint at 0 {
+	port at 0 {
+		vpif_input_ch0: endpoint at 0 {
 			reg = <0>;
 			bus-width = <8>;
 		};
 
-		vpif_ch1: endpoint at 1 {
+		vpif_input_ch1: endpoint at 1 {
 			reg = <1>;
 			bus-width = <8>;
 			data-shift = <8>;
 		};
 	};
+
+	/* VPIF display port */
+	port at 1 {
+		vpif_output_ch0: endpoint at 0 {
+			reg = <0>;
+			bus-width = <8>;
+		};
+	};
 };
arch/arm/boot/dts/da850.dtsi +7 -1
index 69ec5e7..768a58c 100644
@@ -494,7 +494,13 @@
 			status = "disabled";
 
 			/* VPIF capture port */
-			port {
+			port at 0 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+
+			/* VPIF display port */
+			port at 1 {
 				#address-cells = <1>;
 				#size-cells = <0>;
 			};
Signature · 1 line
2.9.3
#14 lore raw

PATCH 5/10 ARM: dts: da850: add vpif video display pins

In reply to Bartosz Golaszewski

Add a new pinctrl sub-node for vpif display pins. Move VP_CLKIN3 and VP_CLKIN2 to the display node where they actually belong (vide section 35.2.2 of the da850 datasheet).

---
 arch/arm/boot/dts/da850-evm.dts |  2 +-
 arch/arm/boot/dts/da850.dtsi    | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)
arch/arm/boot/dts/da850-evm.dts +1 -1
index 3d6dd66..6db16ba 100644
@@ -295,7 +295,7 @@
 
 &vpif {
 	pinctrl-names = "default";
-	pinctrl-0 = <&vpif_capture_pins>;
+	pinctrl-0 = <&vpif_capture_pins>, <&vpif_display_pins>;
 	status = "okay";
 
 	/* VPIF capture port */
arch/arm/boot/dts/da850.dtsi +15 -2
index 768a58c..d317bc5 100644
@@ -218,8 +218,21 @@
 					0x3c 0x11111111 0xffffffff
 					/* VP_DIN[8..9] */
 					0x40 0x00000011 0x000000ff
-					/* VP_CLKIN3, VP_CLKIN2 */
-					0x4c 0x00010100 0x000f0f00
+				>;
+			};
+			vpif_display_pins: vpif_display_pins {
+				pinctrl-single,bits = <
+					/* VP_DOUT[2..7] */
+					0x40 0x11111100 0xffffff00
+					/* VP_DOUT[10..15,0..1] */
+					0x44 0x11111111 0xffffffff
+					/*  VP_DOUT[8..9] */
+					0x48 0x00000011 0x000000ff
+					/*
+					 * VP_CLKOUT3, VP_CLKIN3,
+					 * VP_CLKOUT2, VP_CLKIN2
+					 */
+					0x4c 0x00111100 0x00ffff00
 				>;
 			};
 		};
Signature · 1 line
2.9.3
#15 lore raw

PATCH 6/10 ARM: davinci_all_defconfig: enable VPIF display modules

In reply to Bartosz Golaszewski

Enable the VPIF display module and the video encoder present on the da850-evm UI board.

---
 arch/arm/configs/davinci_all_defconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/configs/davinci_all_defconfig +2 -0
index 7815a52..e188b02 100644
@@ -137,9 +137,11 @@ CONFIG_DRM_DUMB_VGA_DAC=m
 CONFIG_MEDIA_SUPPORT=m
 CONFIG_MEDIA_CAMERA_SUPPORT=y
 CONFIG_V4L_PLATFORM_DRIVERS=y
+CONFIG_VIDEO_DAVINCI_VPIF_DISPLAY=m
 CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE=m
 # CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
 CONFIG_VIDEO_TVP514X=m
+CONFIG_VIDEO_ADV7343=m
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_DA8XX=y
Signature · 1 line
2.9.3
#16 lore raw

PATCH 7/10 ARM: davinci: fix a whitespace error

In reply to Bartosz Golaszewski

There's a stray tab in da850_vpif_legacy_init(). Remove it.

---
 arch/arm/mach-davinci/pdata-quirks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-davinci/pdata-quirks.c +1 -1
index a186513..94948c1 100644
@@ -111,7 +111,7 @@ static struct vpif_capture_config da850_vpif_capture_config = {
 static void __init da850_vpif_legacy_init(void)
 {
 	int ret;
-	
+
 	/* LCDK doesn't have the 2nd TVP514x on CH1 */
 	if (of_machine_is_compatible("ti,da850-lcdk"))
 		da850_vpif_capture_config.subdev_count = 1;
Signature · 1 line
2.9.3
#17 lore raw

Re: [PATCH 07/10] ARM: davinci: fix a whitespace error

Quoted 3 lines · Bartosz Golaszewski

There's a stray tab in da850_vpif_legacy_init(). Remove it.

Folding into the original,

Kevin

Quoted 17 lines
---
 arch/arm/mach-davinci/pdata-quirks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-davinci/pdata-quirks.c +1 -1
index a186513..94948c1 100644
@@ -111,7 +111,7 @@ static struct vpif_capture_config da850_vpif_capture_config = {
 static void __init da850_vpif_legacy_init(void)
 {
 	int ret;
-	
+
 	/* LCDK doesn't have the 2nd TVP514x on CH1 */
 	if (of_machine_is_compatible("ti,da850-lcdk"))
 		da850_vpif_capture_config.subdev_count = 1;
#18 lore raw

Re: [PATCH 07/10] ARM: davinci: fix a whitespace error

Quoted 7 lines · Kevin Hilman
Quoted 3 lines · Bartosz Golaszewski

There's a stray tab in da850_vpif_legacy_init(). Remove it.

Folding into the original,

Looks like the version in Sekhar's v4.11/soc branch already has this fixed.

Kevin

#19 lore raw

PATCH 8/10 ARM: davinci: fix the DT boot on da850-evm

In reply to Bartosz Golaszewski

When we enable vpif capture on the da850-evm we hit a BUG_ON() because the i2c adapter can't be found. The board file boot uses i2c adapter 1 but in the DT mode it's actually adapter 0. Drop the problematic lines.

---
 arch/arm/mach-davinci/pdata-quirks.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/mach-davinci/pdata-quirks.c +0 -4
index 94948c1..09f62ac 100644
@@ -116,10 +116,6 @@ static void __init da850_vpif_legacy_init(void)
 	if (of_machine_is_compatible("ti,da850-lcdk"))
 		da850_vpif_capture_config.subdev_count = 1;
 
-	/* EVM (UI card) uses i2c adapter 1 (not default: zero) */
-	if (of_machine_is_compatible("ti,da850-evm"))
-		da850_vpif_capture_config.i2c_adapter_id = 1;
-
 	ret = da850_register_vpif_capture(&da850_vpif_capture_config);
 	if (ret)
 		pr_warn("%s: VPIF capture setup failed: %d\n",
Signature · 1 line
2.9.3
Acked-by on v1 8/10
#20 lore raw

Re: [PATCH 08/10] ARM: davinci: fix the DT boot on da850-evm

Quoted 14 lines · Bartosz Golaszewski

When we enable vpif capture on the da850-evm we hit a BUG_ON() because the i2c adapter can't be found. The board file boot uses i2c adapter 1 but in the DT mode it's actually adapter 0. Drop the problematic lines.

---
 arch/arm/mach-davinci/pdata-quirks.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/mach-davinci/pdata-quirks.c +0 -0
index 94948c1..09f62ac 100644

arch/arm/mach-davinci/pdata-quirks.c static void __init da850_vpif_legacy_init(void) · line 122

Quoted 7 lines
arch/arm/mach-davinci/pdata-quirks.c +0 -4
@@ -116,10 +116,6 @@ static void __init da850_vpif_legacy_init(void)
 	if (of_machine_is_compatible("ti,da850-lcdk"))
 		da850_vpif_capture_config.subdev_count = 1;
 
-	/* EVM (UI card) uses i2c adapter 1 (not default: zero) */
-	if (of_machine_is_compatible("ti,da850-evm"))
-		da850_vpif_capture_config.i2c_adapter_id = 1;
-

oops, my bad.

Quoted 3 lines
arch/arm/mach-davinci/pdata-quirks.c +0 -0
 	ret = da850_register_vpif_capture(&da850_vpif_capture_config);
 	if (ret)
 		pr_warn("%s: VPIF capture setup failed: %d\n",
#21 lore raw

Re: [PATCH 08/10] ARM: davinci: fix the DT boot on da850-evm

Quoted 19 lines · Kevin Hilman
Quoted 17 lines · Bartosz Golaszewski

When we enable vpif capture on the da850-evm we hit a BUG_ON() because the i2c adapter can't be found. The board file boot uses i2c adapter 1 but in the DT mode it's actually adapter 0. Drop the problematic lines.

---
 arch/arm/mach-davinci/pdata-quirks.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/mach-davinci/pdata-quirks.c +0 -0
index 94948c1..09f62ac 100644
@@ -116,10 +116,6 @@ static void __init da850_vpif_legacy_init(void)
 	if (of_machine_is_compatible("ti,da850-lcdk"))
 		da850_vpif_capture_config.subdev_count = 1;
 
Quoted 8 lines

arch/arm/mach-davinci/pdata-quirks.c static void __init da850_vpif_legacy_init(void) · line 122

Quoted 4 lines
arch/arm/mach-davinci/pdata-quirks.c +0 -4
-	/* EVM (UI card) uses i2c adapter 1 (not default: zero) */
-	if (of_machine_is_compatible("ti,da850-evm"))
-		da850_vpif_capture_config.i2c_adapter_id = 1;
-

oops, my bad.

The offending code is not in my master branch. Since its almost certain that VPIF platform support is going to wait for v4.12, can you or Kevin please update Kevin's original patches with these fixes rolled in?

Thanks,
Sekhar

#22 lore raw

Re: [PATCH 08/10] ARM: davinci: fix the DT boot on da850-evm

2017-02-09 16:23 GMT+01:00 Sekhar Nori <[email protected]>:

Quoted 27 lines · Kevin Hilman
Quoted 26 lines
Quoted 14 lines · Bartosz Golaszewski

When we enable vpif capture on the da850-evm we hit a BUG_ON() because the i2c adapter can't be found. The board file boot uses i2c adapter 1 but in the DT mode it's actually adapter 0. Drop the problematic lines.

---
 arch/arm/mach-davinci/pdata-quirks.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/mach-davinci/pdata-quirks.c +0 -0
index 94948c1..09f62ac 100644

arch/arm/mach-davinci/pdata-quirks.c static void __init da850_vpif_legacy_init(void) · line 122

Quoted 7 lines
arch/arm/mach-davinci/pdata-quirks.c +0 -4
@@ -116,10 +116,6 @@ static void __init da850_vpif_legacy_init(void)
     if (of_machine_is_compatible("ti,da850-lcdk"))
             da850_vpif_capture_config.subdev_count = 1;
 
-    /* EVM (UI card) uses i2c adapter 1 (not default: zero) */
-    if (of_machine_is_compatible("ti,da850-evm"))
-            da850_vpif_capture_config.i2c_adapter_id = 1;
-

oops, my bad.

Quoted 9 lines
Quoted 1 line

The offending code is not in my master branch. Since its almost certain that VPIF platform support is going to wait for v4.12, can you or Kevin please update Kevin's original patches with these fixes rolled in?

Thanks,
Sekhar

Sure, I based my series on Kevin's integration branch for 4.10.

Thanks,
Bartosz

#23 lore raw

Re: [PATCH 08/10] ARM: davinci: fix the DT boot on da850-evm

In reply to Sekhar Nori
Quoted 27 lines · Sekhar Nori
Quoted 26 lines · Kevin Hilman
Quoted 14 lines · Bartosz Golaszewski

When we enable vpif capture on the da850-evm we hit a BUG_ON() because the i2c adapter can't be found. The board file boot uses i2c adapter 1 but in the DT mode it's actually adapter 0. Drop the problematic lines.

---
 arch/arm/mach-davinci/pdata-quirks.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/mach-davinci/pdata-quirks.c +0 -0
index 94948c1..09f62ac 100644

arch/arm/mach-davinci/pdata-quirks.c static void __init da850_vpif_legacy_init(void) · line 122

Quoted 7 lines
arch/arm/mach-davinci/pdata-quirks.c +0 -4
@@ -116,10 +116,6 @@ static void __init da850_vpif_legacy_init(void)
 	if (of_machine_is_compatible("ti,da850-lcdk"))
 		da850_vpif_capture_config.subdev_count = 1;
 
-	/* EVM (UI card) uses i2c adapter 1 (not default: zero) */
-	if (of_machine_is_compatible("ti,da850-evm"))
-		da850_vpif_capture_config.i2c_adapter_id = 1;
-

oops, my bad.

Quoted 5 lines
Quoted 1 line

The offending code is not in my master branch. Since its almost certain that VPIF platform support is going to wait for v4.12, can you or Kevin please update Kevin's original patches with these fixes rolled in?

I'm folding this into the original patch.

Kevin

#24 lore raw

PATCH 9/10 media: vpif: use a configurable i2c_adapter_id for vpif display

In reply to Bartosz Golaszewski

The vpif display driver uses a static i2c adapter ID of 1 but on the da850-evm board in DT boot mode the i2c adapter ID is actually 0.

Make the adapter ID configurable like it already is for vpif capture.

---
 arch/arm/mach-davinci/board-da850-evm.c       | 1 +
 drivers/media/platform/davinci/vpif_display.c | 2 +-
 include/media/davinci/vpif_types.h            | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/board-da850-evm.c +1 -0
index e5d4ded..fe0bfa7 100644
@@ -1290,6 +1290,7 @@ static struct vpif_display_config da850_vpif_display_config = {
 		.output_count = ARRAY_SIZE(da850_ch0_outputs),
 	},
 	.card_name    = "DA850/OMAP-L138 Video Display",
+	.i2c_adapter_id = 1,
 };
 
 static __init void da850_vpif_init(void)
drivers/media/platform/davinci/vpif_display.c +1 -1
index 50c3073..7e5cf99 100644
@@ -1287,7 +1287,7 @@ static __init int vpif_probe(struct platform_device *pdev)
 	}
 
 	if (!vpif_obj.config->asd_sizes) {
-		i2c_adap = i2c_get_adapter(1);
+		i2c_adap = i2c_get_adapter(vpif_obj.config->i2c_adapter_id);
 		for (i = 0; i < subdev_count; i++) {
 			vpif_obj.sd[i] =
 				v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev,
include/media/davinci/vpif_types.h +1 -0
index 4282a7d..0c72b46 100644
@@ -57,6 +57,7 @@ struct vpif_display_config {
 	int (*set_clock)(int, int);
 	struct vpif_subdev_info *subdevinfo;
 	int subdev_count;
+	int i2c_adapter_id;
 	struct vpif_display_chan_config chan_config[VPIF_DISPLAY_MAX_CHANNELS];
 	const char *card_name;
 	struct v4l2_async_subdev **asd;	/* Flat array, arranged in groups */
Signature · 1 line
2.9.3
Acked-by on v1 9/10
#25 lore raw

Re: [PATCH 09/10] media: vpif: use a configurable i2c_adapter_id for vpif display

Quoted 6 lines · Bartosz Golaszewski

The vpif display driver uses a static i2c adapter ID of 1 but on the da850-evm board in DT boot mode the i2c adapter ID is actually 0.

Make the adapter ID configurable like it already is for vpif capture.

Quoted 43 lines
---
 arch/arm/mach-davinci/board-da850-evm.c       | 1 +
 drivers/media/platform/davinci/vpif_display.c | 2 +-
 include/media/davinci/vpif_types.h            | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/board-da850-evm.c +1 -0
index e5d4ded..fe0bfa7 100644
@@ -1290,6 +1290,7 @@ static struct vpif_display_config da850_vpif_display_config = {
 		.output_count = ARRAY_SIZE(da850_ch0_outputs),
 	},
 	.card_name    = "DA850/OMAP-L138 Video Display",
+	.i2c_adapter_id = 1,
 };
 
 static __init void da850_vpif_init(void)
drivers/media/platform/davinci/vpif_display.c +1 -1
index 50c3073..7e5cf99 100644
@@ -1287,7 +1287,7 @@ static __init int vpif_probe(struct platform_device *pdev)
 	}
 
 	if (!vpif_obj.config->asd_sizes) {
-		i2c_adap = i2c_get_adapter(1);
+		i2c_adap = i2c_get_adapter(vpif_obj.config->i2c_adapter_id);
 		for (i = 0; i < subdev_count; i++) {
 			vpif_obj.sd[i] =
 				v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev,
include/media/davinci/vpif_types.h +1 -0
index 4282a7d..0c72b46 100644
@@ -57,6 +57,7 @@ struct vpif_display_config {
 	int (*set_clock)(int, int);
 	struct vpif_subdev_info *subdevinfo;
 	int subdev_count;
+	int i2c_adapter_id;
 	struct vpif_display_chan_config chan_config[VPIF_DISPLAY_MAX_CHANNELS];
 	const char *card_name;
 	struct v4l2_async_subdev **asd;	/* Flat array, arranged in groups */
#26 lore raw

PATCH 10/10 ARM: davinci: add pdata-quirks for da850-evm vpif display

In reply to Bartosz Golaszewski

Similarly to vpif capture: we need to register the vpif display driver and the corresponding adv7343 encoder in pdata-quirks as the DT support is not complete.

---
 arch/arm/mach-davinci/pdata-quirks.c | 86 +++++++++++++++++++++++++++++++++++-
 1 file changed, 85 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/pdata-quirks.c +85 -1
index 09f62ac..0a55546 100644
@@ -9,13 +9,17 @@
  */
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
+#include <linux/gpio.h>
 
 #include <media/i2c/tvp514x.h>
+#include <media/i2c/adv7343.h>
 
 #include <mach/common.h>
 #include <mach/da8xx.h>
 #include <mach/mux.h>
 
+#define DA850_EVM_UI_EXP_SEL_VPIF_DISP 5
+
 struct pdata_init {
 	const char *compatible;
 	void (*fn)(void);
@@ -107,7 +111,78 @@ static struct vpif_capture_config da850_vpif_capture_config = {
 	},
 	.card_name = "DA850/OMAP-L138 Video Capture",
 };
+#endif /* IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) */
+
+#if defined(CONFIG_DA850_UI_SD_VIDEO_PORT)
+static void vpif_evm_display_setup(void)
+{
+	int gpio = DAVINCI_N_GPIO + DA850_EVM_UI_EXP_SEL_VPIF_DISP, ret;
+
+	ret = gpio_request(gpio, "sel_c");
+	if (ret) {
+		pr_warn("Cannot open UI expander pin %d\n", gpio);
+		return;
+	}
+
+	gpio_direction_output(gpio, 0);
+}
+
+static struct adv7343_platform_data adv7343_pdata = {
+	.mode_config = {
+		.dac = { 1, 1, 1 },
+	},
+	.sd_config = {
+		.sd_dac_out = { 1 },
+	},
+};
+
+static struct vpif_subdev_info da850_vpif_subdev[] = {
+	{
+		.name = "adv7343",
+		.board_info = {
+			I2C_BOARD_INFO("adv7343", 0x2a),
+			.platform_data = &adv7343_pdata,
+		},
+	},
+};
 
+static const struct vpif_output da850_ch0_outputs[] = {
+	{
+		.output = {
+			.index = 0,
+			.name = "Composite",
+			.type = V4L2_OUTPUT_TYPE_ANALOG,
+			.capabilities = V4L2_OUT_CAP_STD,
+			.std = V4L2_STD_ALL,
+		},
+		.subdev_name = "adv7343",
+		.output_route = ADV7343_COMPOSITE_ID,
+	},
+	{
+		.output = {
+			.index = 1,
+			.name = "S-Video",
+			.type = V4L2_OUTPUT_TYPE_ANALOG,
+			.capabilities = V4L2_OUT_CAP_STD,
+			.std = V4L2_STD_ALL,
+		},
+		.subdev_name = "adv7343",
+		.output_route = ADV7343_SVIDEO_ID,
+	},
+};
+
+static struct vpif_display_config da850_vpif_display_config = {
+	.subdevinfo   = da850_vpif_subdev,
+	.subdev_count = ARRAY_SIZE(da850_vpif_subdev),
+	.chan_config[0] = {
+		.outputs = da850_ch0_outputs,
+		.output_count = ARRAY_SIZE(da850_ch0_outputs),
+	},
+	.card_name    = "DA850/OMAP-L138 Video Display",
+};
+#endif /* defined(CONFIG_DA850_UI_SD_VIDEO_PORT) */
+
+#if IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) || defined(CONFIG_DA850_UI_SD_VIDEO_PORT)
 static void __init da850_vpif_legacy_init(void)
 {
 	int ret;
@@ -120,8 +195,17 @@ static void __init da850_vpif_legacy_init(void)
 	if (ret)
 		pr_warn("%s: VPIF capture setup failed: %d\n",
 			__func__, ret);
+
+	/* LCDK doesn't support VPIF display */
+	if (of_machine_is_compatible("ti,da850-evm")) {
+		vpif_evm_display_setup();
+		ret = da850_register_vpif_display(&da850_vpif_display_config);
+		if (ret)
+			pr_warn("%s: VPIF display setup failed: %d\n",
+				__func__, ret);
+	}
 }
-#endif
+#endif /* IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) || defined(CONFIG_DA850_UI_SD_VIDEO_PORT) */
 
 static void pdata_quirks_check(struct pdata_init *quirks)
 {
Signature · 1 line
2.9.3
Reviewed-by on v1 10/10
#27 lore raw

Re: [PATCH 10/10] ARM: davinci: add pdata-quirks for da850-evm vpif display

Quoted 3 lines · Bartosz Golaszewski

Similarly to vpif capture: we need to register the vpif display driver and the corresponding adv7343 encoder in pdata-quirks as the DT support is not complete.

To add a bit more detail to the changelog: DT support is not complete since there isn't currently a way to define the output_routing in the V4L2 drivers (c.f. s_routing) via DT.

Quoted 1 line

minor nit below, otherwise

Quoted 27 lines
---
 arch/arm/mach-davinci/pdata-quirks.c | 86 +++++++++++++++++++++++++++++++++++-
 1 file changed, 85 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/pdata-quirks.c +4 -0
index 09f62ac..0a55546 100644
@@ -9,13 +9,17 @@
  */
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
+#include <linux/gpio.h>
 
 #include <media/i2c/tvp514x.h>
+#include <media/i2c/adv7343.h>
 
 #include <mach/common.h>
 #include <mach/da8xx.h>
 #include <mach/mux.h>
 
+#define DA850_EVM_UI_EXP_SEL_VPIF_DISP 5
+
 struct pdata_init {
 	const char *compatible;
 	void (*fn)(void);

arch/arm/mach-davinci/pdata-quirks.c static struct vpif_capture_config da850_vpif_capture_config = { · line 116

Quoted 6 lines
arch/arm/mach-davinci/pdata-quirks.c +3 -0
@@ -107,7 +111,78 @@ static struct vpif_capture_config da850_vpif_capture_config = {
 	},
 	.card_name = "DA850/OMAP-L138 Video Capture",
 };
+#endif /* IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) */
+
+#if defined(CONFIG_DA850_UI_SD_VIDEO_PORT)

Why not IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) also here?

Quoted 91 lines
arch/arm/mach-davinci/pdata-quirks.c +78 -1
+static void vpif_evm_display_setup(void)
+{
+	int gpio = DAVINCI_N_GPIO + DA850_EVM_UI_EXP_SEL_VPIF_DISP, ret;
+
+	ret = gpio_request(gpio, "sel_c");
+	if (ret) {
+		pr_warn("Cannot open UI expander pin %d\n", gpio);
+		return;
+	}
+
+	gpio_direction_output(gpio, 0);
+}
+
+static struct adv7343_platform_data adv7343_pdata = {
+	.mode_config = {
+		.dac = { 1, 1, 1 },
+	},
+	.sd_config = {
+		.sd_dac_out = { 1 },
+	},
+};
+
+static struct vpif_subdev_info da850_vpif_subdev[] = {
+	{
+		.name = "adv7343",
+		.board_info = {
+			I2C_BOARD_INFO("adv7343", 0x2a),
+			.platform_data = &adv7343_pdata,
+		},
+	},
+};
 
+static const struct vpif_output da850_ch0_outputs[] = {
+	{
+		.output = {
+			.index = 0,
+			.name = "Composite",
+			.type = V4L2_OUTPUT_TYPE_ANALOG,
+			.capabilities = V4L2_OUT_CAP_STD,
+			.std = V4L2_STD_ALL,
+		},
+		.subdev_name = "adv7343",
+		.output_route = ADV7343_COMPOSITE_ID,
+	},
+	{
+		.output = {
+			.index = 1,
+			.name = "S-Video",
+			.type = V4L2_OUTPUT_TYPE_ANALOG,
+			.capabilities = V4L2_OUT_CAP_STD,
+			.std = V4L2_STD_ALL,
+		},
+		.subdev_name = "adv7343",
+		.output_route = ADV7343_SVIDEO_ID,
+	},
+};
+
+static struct vpif_display_config da850_vpif_display_config = {
+	.subdevinfo   = da850_vpif_subdev,
+	.subdev_count = ARRAY_SIZE(da850_vpif_subdev),
+	.chan_config[0] = {
+		.outputs = da850_ch0_outputs,
+		.output_count = ARRAY_SIZE(da850_ch0_outputs),
+	},
+	.card_name    = "DA850/OMAP-L138 Video Display",
+};
+#endif /* defined(CONFIG_DA850_UI_SD_VIDEO_PORT) */
+
+#if IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) || defined(CONFIG_DA850_UI_SD_VIDEO_PORT)
 static void __init da850_vpif_legacy_init(void)
 {
 	int ret;
@@ -120,8 +195,17 @@ static void __init da850_vpif_legacy_init(void)
 	if (ret)
 		pr_warn("%s: VPIF capture setup failed: %d\n",
 			__func__, ret);
+
+	/* LCDK doesn't support VPIF display */
+	if (of_machine_is_compatible("ti,da850-evm")) {
+		vpif_evm_display_setup();
+		ret = da850_register_vpif_display(&da850_vpif_display_config);
+		if (ret)
+			pr_warn("%s: VPIF display setup failed: %d\n",
+				__func__, ret);
+	}
 }
-#endif
+#endif /* IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) || defined(CONFIG_DA850_UI_SD_VIDEO_PORT) */
 
 static void pdata_quirks_check(struct pdata_init *quirks)
 {
#28 lore raw

Re: [PATCH 10/10] ARM: davinci: add pdata-quirks for da850-evm vpif display

2017-02-07 19:20 GMT+01:00 Kevin Hilman <[email protected]>:

Quoted 10 lines
Quoted 3 lines · Bartosz Golaszewski

Similarly to vpif capture: we need to register the vpif display driver and the corresponding adv7343 encoder in pdata-quirks as the DT support is not complete.

To add a bit more detail to the changelog: DT support is not complete since there isn't currently a way to define the output_routing in the V4L2 drivers (c.f. s_routing) via DT.

I'll add this in v2.

Quoted 27 lines
Quoted 1 line

minor nit below, otherwise

Quoted 21 lines
---
 arch/arm/mach-davinci/pdata-quirks.c | 86 +++++++++++++++++++++++++++++++++++-
 1 file changed, 85 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/pdata-quirks.c +2 -0
index 09f62ac..0a55546 100644
@@ -9,13 +9,17 @@
  */
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
+#include <linux/gpio.h>
 
 #include <media/i2c/tvp514x.h>
+#include <media/i2c/adv7343.h>
 
 #include <mach/common.h>
 #include <mach/da8xx.h>
 #include <mach/mux.h>
 
Quoted 14 lines

arch/arm/mach-davinci/pdata-quirks.c static struct vpif_capture_config da850_vpif_capture_config = { · line 116

Quoted 12 lines
arch/arm/mach-davinci/pdata-quirks.c +5 -0
+#define DA850_EVM_UI_EXP_SEL_VPIF_DISP 5
+
 struct pdata_init {
      const char *compatible;
      void (*fn)(void);
@@ -107,7 +111,78 @@ static struct vpif_capture_config da850_vpif_capture_config = {
      },
      .card_name = "DA850/OMAP-L138 Video Capture",
 };
+#endif /* IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) */
+
+#if defined(CONFIG_DA850_UI_SD_VIDEO_PORT)

Why not IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) also here?

Just a reflex ;)

I'll fix this too.

Thanks,
Bartosz

#29 lore raw

Re: [PATCH 10/10] ARM: davinci: add pdata-quirks for da850-evm vpif display

In reply to Bartosz Golaszewski

Hi Bartosz,

Quoted 40 lines · Bartosz Golaszewski

Similarly to vpif capture: we need to register the vpif display driver and the corresponding adv7343 encoder in pdata-quirks as the DT support is not complete.

---
 arch/arm/mach-davinci/pdata-quirks.c | 86 +++++++++++++++++++++++++++++++++++-
 1 file changed, 85 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/pdata-quirks.c +9 -0
index 09f62ac..0a55546 100644
@@ -9,13 +9,17 @@
  */
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
+#include <linux/gpio.h>
 
 #include <media/i2c/tvp514x.h>
+#include <media/i2c/adv7343.h>
 
 #include <mach/common.h>
 #include <mach/da8xx.h>
 #include <mach/mux.h>
 
+#define DA850_EVM_UI_EXP_SEL_VPIF_DISP 5
+
 struct pdata_init {
 	const char *compatible;
 	void (*fn)(void);
@@ -107,7 +111,78 @@ static struct vpif_capture_config da850_vpif_capture_config = {
 	},
 	.card_name = "DA850/OMAP-L138 Video Capture",
 };
+#endif /* IS_ENABLED(CONFIG_VIDEO_DAVINCI_VPIF_CAPTURE) */
+
+#if defined(CONFIG_DA850_UI_SD_VIDEO_PORT)
+static void vpif_evm_display_setup(void)
+{

arch/arm/mach-davinci/pdata-quirks.c static struct vpif_capture_config da850_vpif_capture_config = { · line 128

Quoted 10 lines
arch/arm/mach-davinci/pdata-quirks.c +10 -0
+	int gpio = DAVINCI_N_GPIO + DA850_EVM_UI_EXP_SEL_VPIF_DISP, ret;
+
+	ret = gpio_request(gpio, "sel_c");
+	if (ret) {
+		pr_warn("Cannot open UI expander pin %d\n", gpio);
+		return;
+	}
+
+	gpio_direction_output(gpio, 0);
+}

I had a closer look at the UI board schematic, and it looks like the SEL_C line of the GPIO exapander is actualy to select the VPIF *input* source, not output, so I don't think it should be needed in this patch.

Can you test VPIF display works without calling this function?

Kevin

#30 lore raw
In reply to Bartosz Golaszewski

Hi Bartosz,

Quoted 15 lines · Bartosz Golaszewski

The following series adds support for v4l2 display on da850-evm with a UI board in device tree boot mode.

Patches 1/10 - 5/10 deal with the device tree: we fix whitespace errors in dts files and bindings, extend the example and the dts for da850-evm with the output port and address the pinmuxing.

Patch 6/10 enables the relevant modules in the defconfig file.

Patches 7/10 and 8/10 fix two already existing bugs encountered during development.

Patch 9/10 make it possible to use a different i2c adapter in the vpif display driver.

Quoted 6 lines

The last patch adds the pdata quirks necessary to enable v4l2 display.

Tested with a modified version of yavta[1] as gstreamer support for v4l2 seems to be broken and results in picture artifacts.

[1] https://github.com/brgl/yavta davinci/vpif-display

Can you also share the command line you used ?

Thanks,
Sekhar

#31 lore raw

2017-02-13 10:22 GMT+01:00 Sekhar Nori <[email protected]>:

Quoted 23 lines

Hi Bartosz,

Quoted 20 lines · Bartosz Golaszewski

The following series adds support for v4l2 display on da850-evm with a UI board in device tree boot mode.

Patches 1/10 - 5/10 deal with the device tree: we fix whitespace errors in dts files and bindings, extend the example and the dts for da850-evm with the output port and address the pinmuxing.

Patch 6/10 enables the relevant modules in the defconfig file.

Patches 7/10 and 8/10 fix two already existing bugs encountered during development.

Patch 9/10 make it possible to use a different i2c adapter in the vpif display driver.

The last patch adds the pdata quirks necessary to enable v4l2 display.

Tested with a modified version of yavta[1] as gstreamer support for v4l2 seems to be broken and results in picture artifacts.

Quoted 6 lines
Quoted 1 line

[1] https://github.com/brgl/yavta davinci/vpif-display

Can you also share the command line you used ?

Thanks,
Sekhar

Will do. I'll also send separate sets of patches for your different branches as advised by Kevin.

Thanks,
Bartosz

#32 lore raw
In reply to Bartosz Golaszewski
Quoted 2 lines · Bartosz Golaszewski

The following series adds support for v4l2 display on da850-evm with a UI board in device tree boot mode.

As far as I could tell from the comments this patch series will see a second version, so I am marking it as 'Changes Requested' in patchwork.

If I'm wrong, then please let me know.

Regards,

Hans

Quoted 42 lines

Patches 1/10 - 5/10 deal with the device tree: we fix whitespace errors in dts files and bindings, extend the example and the dts for da850-evm with the output port and address the pinmuxing.

Patch 6/10 enables the relevant modules in the defconfig file.

Patches 7/10 and 8/10 fix two already existing bugs encountered during development.

Patch 9/10 make it possible to use a different i2c adapter in the vpif display driver.

The last patch adds the pdata quirks necessary to enable v4l2 display.

Tested with a modified version of yavta[1] as gstreamer support for v4l2 seems to be broken and results in picture artifacts.

[1] https://github.com/brgl/yavta davinci/vpif-display

Bartosz Golaszewski (10):
media: dt-bindings: vpif: fix whitespace errors
ARM: dts: da850-evm: fix whitespace errors
media: dt-bindings: vpif: extend the example with an output port
ARM: dts: da850-evm: add the output port to the vpif node
ARM: dts: da850: add vpif video display pins
ARM: davinci_all_defconfig: enable VPIF display modules
ARM: davinci: fix a whitespace error
ARM: davinci: fix the DT boot on da850-evm
media: vpif: use a configurable i2c_adapter_id for vpif display
ARM: davinci: add pdata-quirks for da850-evm vpif display

 .../devicetree/bindings/media/ti,da850-vpif.txt    | 45 ++++++++---
 arch/arm/boot/dts/da850-evm.dts                    | 26 +++---
 arch/arm/boot/dts/da850.dtsi                       | 25 +++++-
 arch/arm/configs/davinci_all_defconfig             |  2 +
 arch/arm/mach-davinci/board-da850-evm.c            |  1 +
 arch/arm/mach-davinci/pdata-quirks.c               | 92 ++++++++++++++++++++--
 drivers/media/platform/davinci/vpif_display.c      |  2 +-
 include/media/davinci/vpif_types.h                 |  1 +
 8 files changed, 164 insertions(+), 30 deletions(-)
#33 lore raw

2017-03-09 11:53 GMT+01:00 Hans Verkuil <[email protected]>:

Quoted 13 lines · Bartosz Golaszewski
Quoted 2 lines

The following series adds support for v4l2 display on da850-evm with a UI board in device tree boot mode.

As far as I could tell from the comments this patch series will see a second version, so I am marking it as 'Changes Requested' in patchwork.

If I'm wrong, then please let me know.

Regards,

Hans

Hi Hans,

this series has since been split into several smaller ones and most of the code is already merged into Sekhar Nori's DaVinci tree.

There are two series that still need merging with the media tree[1][2].

Thanks,
Bartosz Golaszewski

[1] https://lkml.org/lkml/2017/2/28/426
[2] https://patchwork.kernel.org/patch/9577965/

Applied
#34 lore raw
Quoted 15 lines · Bartosz Golaszewski

2017-03-09 11:53 GMT+01:00 Hans Verkuil <[email protected]>:

Quoted 13 lines · Bartosz Golaszewski
Quoted 2 lines

The following series adds support for v4l2 display on da850-evm with a UI board in device tree boot mode.

As far as I could tell from the comments this patch series will see a second version, so I am marking it as 'Changes Requested' in patchwork.

If I'm wrong, then please let me know.

Regards,

Hans

Quoted 6 lines

Hi Hans,

this series has since been split into several smaller ones and most of the code is already merged into Sekhar Nori's DaVinci tree.

There are two series that still need merging with the media tree[1][2].

Merged, thanks!

Regards,

Hans

Quoted 7 lines

Thanks,
Bartosz Golaszewski

[1] https://lkml.org/lkml/2017/2/28/426
[2] https://patchwork.kernel.org/patch/9577965/