Skip to contentSkip to conversation

media: dt-bindings: extend the vpif bindings

PATCH Superseded Bartosz Golaszewski 3 participants 12 messages Feb 22, 2017 – Mar 1, 2017

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover media: dt-bindings: extend the vpif bindings

This series extends the DT bindings for TI vpif with an output port and enable-gpios property.

The first patch just fixes a couple whitespace errors in the vpif bindings.

The second extends the example with an output port since we want to support vpif display too.

The third adds an optional property for selecting vpif functionality by driving GPIOs which is needed on some boards.

v1 -> v2:
- added patch 3/3
- specified the purpose of port at 0 and port at 1 nodes

Bartosz Golaszewski (3):
media: dt-bindings: vpif: fix whitespace errors
media: dt-bindings: vpif: extend the example with an output port
media: dt-bindings: vpif: new optional property

 .../devicetree/bindings/media/ti,da850-vpif.txt    | 57 +++++++++++++++++-----
 1 file changed, 44 insertions(+), 13 deletions(-)
Signature · 1 line
2.9.3
#1 lore raw

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

The examples have been copied from the DT with whitespace errors. Fix them.

---
 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
#2 lore raw

PATCH v2 2/3 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    | 40 +++++++++++++++++-----
 1 file changed, 32 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +32 -8
index 9c7510b..df7182a 100644
@@ -16,8 +16,10 @@ Required properties:
 Video Capture:
 
 VPIF has a 16-bit parallel bus input, supporting 2 8-bit channels or a
-single 16-bit channel.  It should contain at least one port child node
-with child 'endpoint' node. Please refer to the bindings defined in
+single 16-bit channel. It should contain one or two port child nodes
+with child 'endpoint' node. If there are two ports then port at 0 must
+describe the input and port at 1 output channels. Please refer to the
+bindings defined in
 Documentation/devicetree/bindings/media/video-interfaces.txt.
 
 Example using 2 8-bit input channels, one of which is connected to an
@@ -28,19 +30,26 @@ 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 {
+				bus-width = <8>;
+				remote-endpoint = <&composite_out>;
+			};
+		};
 	};
 
 [ ... ]
@@ -53,13 +62,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 v2 2/3
#3 lore raw

Re: [PATCH v2 2/3] 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    | 40 +++++++++++++++++-----
 1 file changed, 32 insertions(+), 8 deletions(-)
#4 lore raw

PATCH v2 3/3 media: dt-bindings: vpif: new optional property

In reply to Bartosz Golaszewski

Add an optional property - enable-gpios - which can be used to specify the GPIOs that must be requested to select the vpif functionality.

---
 Documentation/devicetree/bindings/media/ti,da850-vpif.txt | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +7 -0
index df7182a..23c5405 100644
@@ -13,6 +13,9 @@ Required properties:
 - reg: physical base address and length of the registers set for the device;
 - interrupts: should contain IRQ line for the VPIF
 
+Optional properties:
+- enable-gpios: phandle of the GPIOs used to select the vpif functionality
+
 Video Capture:
 
 VPIF has a 16-bit parallel bus input, supporting 2 8-bit channels or a
@@ -30,6 +33,10 @@ I2C-connected TVP5147 decoder:
 		reg = <0x217000 0x1000>;
 		interrupts = <92>;
 
+		enable-gpios = <&tca6416 7 GPIO_ACTIVE_HIGH
+				&tca6416 6 GPIO_ACTIVE_HIGH
+				&tca6416 5 GPIO_ACTIVE_LOW>;
+
 		port at 0 {
 			vpif_input_ch0: endpoint at 0 {
 				reg = <0>;
Signature · 1 line
2.9.3
maintainer
#5 lore raw

Re: [PATCH v2 3/3] media: dt-bindings: vpif: new optional property

Quoted 13 lines · Bartosz Golaszewski

Add an optional property - enable-gpios - which can be used to specify the GPIOs that must be requested to select the vpif functionality.

---
 Documentation/devicetree/bindings/media/ti,da850-vpif.txt | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +0 -0
index df7182a..23c5405 100644

Documentation/devicetree/bindings/media/ti,da850-vpif.txt Required properties: · line 17

Quoted 5 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +2 -0
@@ -13,6 +13,9 @@ Required properties:
 - reg: physical base address and length of the registers set for the device;
 - interrupts: should contain IRQ line for the VPIF
 
+Optional properties:
+- enable-gpios: phandle of the GPIOs used to select the vpif functionality

What does this control exactly? The GPIOs belong in the node they are connected to and having GPIOs routed to this block seems strange.

There are inputs or outputs?

Quoted 18 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +5 -0
+
 Video Capture:
 
 VPIF has a 16-bit parallel bus input, supporting 2 8-bit channels or a
@@ -30,6 +33,10 @@ I2C-connected TVP5147 decoder:
 		reg = <0x217000 0x1000>;
 		interrupts = <92>;
 
+		enable-gpios = <&tca6416 7 GPIO_ACTIVE_HIGH
+				&tca6416 6 GPIO_ACTIVE_HIGH
+				&tca6416 5 GPIO_ACTIVE_LOW>;
+
 		port at 0 {
 			vpif_input_ch0: endpoint at 0 {
 				reg = <0>;
Signature · 1 line
2.9.3
#6 lore raw

Re: [PATCH v2 3/3] media: dt-bindings: vpif: new optional property

Quoted 17 lines · Rob Herring
Quoted 16 lines · Bartosz Golaszewski

Add an optional property - enable-gpios - which can be used to specify the GPIOs that must be requested to select the vpif functionality.

---
 Documentation/devicetree/bindings/media/ti,da850-vpif.txt | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +0 -0
index df7182a..23c5405 100644
@@ -13,6 +13,9 @@ Required properties:
 - reg: physical base address and length of the registers set for the device;
 - interrupts: should contain IRQ line for the VPIF
 
Quoted 5 lines

Documentation/devicetree/bindings/media/ti,da850-vpif.txt Required properties: · line 17

Quoted 2 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +2 -0
+Optional properties:
+- enable-gpios: phandle of the GPIOs used to select the vpif functionality

What does this control exactly? The GPIOs belong in the node they are connected to and having GPIOs routed to this block seems strange.

The DA850 EVM board implements on-board muxing which lets the video input (via VPIF) to be routed to a TVP5147 (video decoder) for composite input or to a camera header. There are other mux options which use the same VPIF SoC pins (RMII ethernet or character LCD).

There is a three-to-eight demux on the board which drives enable signals to buffers letting you choose from these options.

Quoted 1 line

From your response, it looks like you want the enable-gpios property to

be in the TVP5147 or camera node. That does make sense to me.

Quoted 2 lines

There are inputs or outputs?

These GPIOs are driving a 3-to-8 demux so they are all outputs.

Thanks,
Sekhar

#7 lore raw

Re: [PATCH v2 3/3] media: dt-bindings: vpif: new optional property

2017-02-28 6:36 GMT+01:00 Sekhar Nori <[email protected]>:

Quoted 29 lines · Rob Herring
Quoted 17 lines · Bartosz Golaszewski
Quoted 16 lines

Add an optional property - enable-gpios - which can be used to specify the GPIOs that must be requested to select the vpif functionality.

---
 Documentation/devicetree/bindings/media/ti,da850-vpif.txt | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +0 -0
index df7182a..23c5405 100644
@@ -13,6 +13,9 @@ Required properties:
 - reg: physical base address and length of the registers set for the device;
 - interrupts: should contain IRQ line for the VPIF
 
Quoted 5 lines

Documentation/devicetree/bindings/media/ti,da850-vpif.txt Required properties: · line 17

Quoted 2 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +2 -0
+Optional properties:
+- enable-gpios: phandle of the GPIOs used to select the vpif functionality

What does this control exactly? The GPIOs belong in the node they are connected to and having GPIOs routed to this block seems strange.

The DA850 EVM board implements on-board muxing which lets the video input (via VPIF) to be routed to a TVP5147 (video decoder) for composite input or to a camera header. There are other mux options which use the same VPIF SoC pins (RMII ethernet or character LCD).

Quoted 6 lines

There is a three-to-eight demux on the board which drives enable signals to buffers letting you choose from these options.

From your response, it looks like you want the enable-gpios property to be in the TVP5147 or camera node. That does make sense to me.

Wouldn't that cause races again? The TVP5147 ADC is probed from within the vpif driver as a media subdev (after initialize_vpif(), v4l2_device_register(), irq requests etc.).

Thanks,
Bartosz

#8 lore raw

Re: [PATCH v2 3/3] media: dt-bindings: vpif: new optional property

Quoted 33 lines · Bartosz Golaszewski

2017-02-28 6:36 GMT+01:00 Sekhar Nori <[email protected]>:

Quoted 32 lines · Rob Herring
Quoted 17 lines · Bartosz Golaszewski
Quoted 16 lines

Add an optional property - enable-gpios - which can be used to specify the GPIOs that must be requested to select the vpif functionality.

---
 Documentation/devicetree/bindings/media/ti,da850-vpif.txt | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +0 -0
index df7182a..23c5405 100644
@@ -13,6 +13,9 @@ Required properties:
 - reg: physical base address and length of the registers set for the device;
 - interrupts: should contain IRQ line for the VPIF
 
Quoted 5 lines

Documentation/devicetree/bindings/media/ti,da850-vpif.txt Required properties: · line 17

Quoted 2 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +2 -0
+Optional properties:
+- enable-gpios: phandle of the GPIOs used to select the vpif functionality

What does this control exactly? The GPIOs belong in the node they are connected to and having GPIOs routed to this block seems strange.

The DA850 EVM board implements on-board muxing which lets the video input (via VPIF) to be routed to a TVP5147 (video decoder) for composite input or to a camera header. There are other mux options which use the same VPIF SoC pins (RMII ethernet or character LCD).

There is a three-to-eight demux on the board which drives enable signals to buffers letting you choose from these options.

Quoted 7 lines
Quoted 3 lines

From your response, it looks like you want the enable-gpios property to be in the TVP5147 or camera node. That does make sense to me.

Wouldn't that cause races again? The TVP5147 ADC is probed from within the vpif driver as a media subdev (after initialize_vpif(), v4l2_device_register(), irq requests etc.).

When TVP5147 probe fails with -EPROBE_DEFER, I assume the error can propagate back to vpif_probe() which would then de-register the V4L2 device as part of probe error unwinding. That should then allow the probe to be retried at a later time.

Thanks,
Sekhar

Quoted 4 lines

Thanks,
Bartosz

maintainer
#9 lore raw

Re: [PATCH v2 3/3] media: dt-bindings: vpif: new optional property

In reply to Sekhar Nori
Quoted 29 lines · Sekhar Nori
Quoted 17 lines · Rob Herring
Quoted 16 lines · Bartosz Golaszewski

Add an optional property - enable-gpios - which can be used to specify the GPIOs that must be requested to select the vpif functionality.

---
 Documentation/devicetree/bindings/media/ti,da850-vpif.txt | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +0 -0
index df7182a..23c5405 100644
@@ -13,6 +13,9 @@ Required properties:
 - reg: physical base address and length of the registers set for the device;
 - interrupts: should contain IRQ line for the VPIF
 
Quoted 5 lines

Documentation/devicetree/bindings/media/ti,da850-vpif.txt Required properties: · line 17

Quoted 2 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +2 -0
+Optional properties:
+- enable-gpios: phandle of the GPIOs used to select the vpif functionality

What does this control exactly? The GPIOs belong in the node they are connected to and having GPIOs routed to this block seems strange.

The DA850 EVM board implements on-board muxing which lets the video input (via VPIF) to be routed to a TVP5147 (video decoder) for composite input or to a camera header. There are other mux options which use the same VPIF SoC pins (RMII ethernet or character LCD).

Quoted 5 lines

There is a three-to-eight demux on the board which drives enable signals to buffers letting you choose from these options.

From your response, it looks like you want the enable-gpios property to be in the TVP5147 or camera node. That does make sense to me.

Well, seems like they should be part of a mux node. I'd suggest you look at the video-multiplexer binding under review[1].

Though for other non video functions, that would be some sort of board level pin mux control. There's a new mux binding too, maybe that would work. In any case, it shouldn't be the VPIF driver controlling the GPIOs directly.

Rob

[1] https://lkml.org/lkml/2017/1/6/1056

#10 lore raw

Re: [PATCH v2 3/3] media: dt-bindings: vpif: new optional property

Quoted 36 lines · Rob Herring
Quoted 29 lines · Sekhar Nori
Quoted 17 lines · Rob Herring
Quoted 16 lines · Bartosz Golaszewski

Add an optional property - enable-gpios - which can be used to specify the GPIOs that must be requested to select the vpif functionality.

---
 Documentation/devicetree/bindings/media/ti,da850-vpif.txt | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +0 -0
index df7182a..23c5405 100644
@@ -13,6 +13,9 @@ Required properties:
 - reg: physical base address and length of the registers set for the device;
 - interrupts: should contain IRQ line for the VPIF
 
Quoted 5 lines

Documentation/devicetree/bindings/media/ti,da850-vpif.txt Required properties: · line 17

Quoted 2 lines
Documentation/devicetree/bindings/media/ti,da850-vpif.txt +2 -0
+Optional properties:
+- enable-gpios: phandle of the GPIOs used to select the vpif functionality

What does this control exactly? The GPIOs belong in the node they are connected to and having GPIOs routed to this block seems strange.

The DA850 EVM board implements on-board muxing which lets the video input (via VPIF) to be routed to a TVP5147 (video decoder) for composite input or to a camera header. There are other mux options which use the same VPIF SoC pins (RMII ethernet or character LCD).

Quoted 5 lines

There is a three-to-eight demux on the board which drives enable signals to buffers letting you choose from these options.

From your response, it looks like you want the enable-gpios property to be in the TVP5147 or camera node. That does make sense to me.

Quoted 7 lines

Well, seems like they should be part of a mux node. I'd suggest you look at the video-multiplexer binding under review[1].

Though for other non video functions, that would be some sort of board level pin mux control. There's a new mux binding too, maybe that would work. In any case, it shouldn't be the VPIF driver controlling the GPIOs directly.

Yeah, since there are non-video functions involved, we need a more generic mux binding. I see the work Peter Rosin is doing[1]. Its not in linux-next yet, but seems quite near merging.

[1] https://lkml.org/lkml/2017/2/8/394

Thanks,
Sekhar

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

This series extends the DT bindings for TI vpif with an output port and enable-gpios property.

This needs to go through Hans / Mauro and the media subsystem list. Can you please send with them copied next time.

Thanks,
Sekhar