linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Renesas Lager: Device Tree entries for VIN HDMI input, version 2
@ 2015-08-13 11:36 William Towle
  2015-08-13 11:36 ` [PATCH 1/3] ARM: shmobile: lager dts: Add entries for VIN HDMI input support William Towle
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: William Towle @ 2015-08-13 11:36 UTC (permalink / raw)
  To: linux-media, linux-kernel
  Cc: linux-sh, Guennadi Liakhovetski, Sergei Shtylyov,
	Laurent Pinchart, Hans Verkuil

  Version 2 ... removes some redundant configuration from device nodes,
and provides some supplementary logic for automatic initialisation of
state->pdata.default_input based on the hardware present.

  (Obsoletes corresponding parts of "HDMI and Composite capture on
Lager...", published previously)

Cheers,
  Wills.

To follow:
	[PATCH 1/3] ARM: shmobile: lager dts: Add entries for VIN HDMI input
	[PATCH 2/3] media: adv7604: automatic "default-input" selection
	[PATCH 3/3] ARM: shmobile: lager dts: specify default-input for

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

* [PATCH 1/3] ARM: shmobile: lager dts: Add entries for VIN HDMI input support
  2015-08-13 11:36 Renesas Lager: Device Tree entries for VIN HDMI input, version 2 William Towle
@ 2015-08-13 11:36 ` William Towle
  2015-08-13 11:36 ` [PATCH 2/3] media: adv7604: automatic "default-input" selection William Towle
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: William Towle @ 2015-08-13 11:36 UTC (permalink / raw)
  To: linux-media, linux-kernel
  Cc: linux-sh, Guennadi Liakhovetski, Sergei Shtylyov,
	Laurent Pinchart, Hans Verkuil

Add DT entries for vin0, vin0_pins, and adv7612.

Signed-off-by: William Towle <william.towle@codethink.co.uk>
Signed-off-by: Rob Taylor <rob.taylor@codethink.co.uk>
---
 arch/arm/boot/dts/r8a7790-lager.dts |   37 ++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index e02b523..31854bc 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -378,7 +378,12 @@
 		renesas,function = "usb2";
 	};
 
-	vin1_pins: vin {
+	vin0_pins: vin0 {
+		renesas,groups = "vin0_data24", "vin0_sync", "vin0_clkenb", "vin0_clk";
+		renesas,function = "vin0";
+	};
+
+	vin1_pins: vin1 {
 		renesas,groups = "vin1_data8", "vin1_clk";
 		renesas,function = "vin1";
 	};
@@ -539,6 +544,17 @@
 		reg = <0x12>;
 	};
 
+	hdmi-in@4c {
+		compatible = "adi,adv7612";
+		reg = <0x4c>;
+
+		port {
+			hdmi_in_ep: endpoint {
+				remote-endpoint = <&vin0ep0>;
+			};
+		};
+	};
+
 	composite-in@20 {
 		compatible = "adi,adv7180";
 		reg = <0x20>;
@@ -654,6 +670,25 @@
 	status = "okay";
 };
 
+/* HDMI video input */
+&vin0 {
+	pinctrl-0 = <&vin0_pins>;
+	pinctrl-names = "default";
+
+	status = "ok";
+
+	port {
+		vin0ep0: endpoint {
+			remote-endpoint = <&hdmi_in_ep>;
+			bus-width = <24>;
+			hsync-active = <0>;
+			vsync-active = <0>;
+			pclk-sample = <1>;
+			data-active = <1>;
+		};
+	};
+};
+
 /* composite video input */
 &vin1 {
 	pinctrl-0 = <&vin1_pins>;
-- 
1.7.10.4


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

* [PATCH 2/3] media: adv7604: automatic "default-input" selection
  2015-08-13 11:36 Renesas Lager: Device Tree entries for VIN HDMI input, version 2 William Towle
  2015-08-13 11:36 ` [PATCH 1/3] ARM: shmobile: lager dts: Add entries for VIN HDMI input support William Towle
@ 2015-08-13 11:36 ` William Towle
  2015-08-13 11:36 ` [PATCH 3/3] ARM: shmobile: lager dts: specify default-input for ADV7612 William Towle
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: William Towle @ 2015-08-13 11:36 UTC (permalink / raw)
  To: linux-media, linux-kernel
  Cc: linux-sh, Guennadi Liakhovetski, Sergei Shtylyov,
	Laurent Pinchart, Hans Verkuil

Add logic such that the "default-input" property becomes unnecessary
for chips that only have one suitable input (ADV7611 by design, and
ADV7612 due to commit 7111cddd "[media] media: adv7604: reduce support
to first (digital) input").

Additionally, Ian's documentation in commit bf9c8227 ("[media] media:
adv7604: ability to read default input port from DT") states that the
"default-input" property should reside directly in the node for
adv7612. Hence, also adjust the parsing to make the implementation
consistent with this.

Signed-off-by: William Towle <william.towle@codethink.co.uk>
---
 drivers/media/i2c/adv7604.c |   25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 5631ec0..5bd81bd 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -2799,7 +2799,7 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
 	struct device_node *endpoint;
 	struct device_node *np;
 	unsigned int flags;
-	u32 v;
+	u32 v= -1;
 
 	np = state->i2c_clients[ADV76XX_PAGE_IO]->dev.of_node;
 
@@ -2809,14 +2809,25 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
 		return -EINVAL;
 
 	v4l2_of_parse_endpoint(endpoint, &bus_cfg);
-
-	if (!of_property_read_u32(endpoint, "default-input", &v))
-		state->pdata.default_input = v;
-	else
-		state->pdata.default_input = -1;
-
 	of_node_put(endpoint);
 
+	if (of_property_read_u32(np, "default-input", &v)) {
+		/* not specified ... can we choose automatically? */
+		switch (state->info->type) {
+		case ADV7611:
+			v = 0;
+			break;
+		case ADV7612:
+			if (state->info->max_port
+					== ADV76XX_PAD_HDMI_PORT_A)
+				v = 0;
+			/* else is unhobbled, leave unspecified */
+		default:
+			break;
+		}
+	}
+	state->pdata.default_input = v;
+
 	flags = bus_cfg.bus.parallel.flags;
 
 	if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
-- 
1.7.10.4


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

* [PATCH 3/3] ARM: shmobile: lager dts: specify default-input for ADV7612
  2015-08-13 11:36 Renesas Lager: Device Tree entries for VIN HDMI input, version 2 William Towle
  2015-08-13 11:36 ` [PATCH 1/3] ARM: shmobile: lager dts: Add entries for VIN HDMI input support William Towle
  2015-08-13 11:36 ` [PATCH 2/3] media: adv7604: automatic "default-input" selection William Towle
@ 2015-08-13 11:36 ` William Towle
  2015-09-18  0:26 ` Renesas Lager: Device Tree entries for VIN HDMI input, version 2 Simon Horman
  2015-09-22 16:36 ` [Linux-kernel] " William Towle
  4 siblings, 0 replies; 6+ messages in thread
From: William Towle @ 2015-08-13 11:36 UTC (permalink / raw)
  To: linux-media, linux-kernel
  Cc: linux-sh, Guennadi Liakhovetski, Sergei Shtylyov,
	Laurent Pinchart, Hans Verkuil

From: Ian Molton <ian.molton@codethink.co.uk>

Set the 'default-input' property for ADV7612, enabling image and video
capture without the need to have userspace specifying routing.

(This version places the property in the adv7612 node, in line with
Ian's documentation)

Signed-off-by: Ian Molton <ian.molton@codethink.co.uk>
Signed-off-by: William Towle <william.towle@codethink.co.uk>
---
 arch/arm/boot/dts/r8a7790-lager.dts |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index 31854bc..12e1cfa 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -547,6 +547,7 @@
 	hdmi-in@4c {
 		compatible = "adi,adv7612";
 		reg = <0x4c>;
+		default-input = <0>;
 
 		port {
 			hdmi_in_ep: endpoint {
-- 
1.7.10.4


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

* Re: Renesas Lager: Device Tree entries for VIN HDMI input, version 2
  2015-08-13 11:36 Renesas Lager: Device Tree entries for VIN HDMI input, version 2 William Towle
                   ` (2 preceding siblings ...)
  2015-08-13 11:36 ` [PATCH 3/3] ARM: shmobile: lager dts: specify default-input for ADV7612 William Towle
@ 2015-09-18  0:26 ` Simon Horman
  2015-09-22 16:36 ` [Linux-kernel] " William Towle
  4 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2015-09-18  0:26 UTC (permalink / raw)
  To: William Towle
  Cc: linux-media, linux-kernel, linux-sh, Guennadi Liakhovetski,
	Sergei Shtylyov, Laurent Pinchart, Hans Verkuil

Hi William,

On Thu, Aug 13, 2015 at 12:36:48PM +0100, William Towle wrote:
>   Version 2 ... removes some redundant configuration from device nodes,
> and provides some supplementary logic for automatic initialisation of
> state->pdata.default_input based on the hardware present.
> 
>   (Obsoletes corresponding parts of "HDMI and Composite capture on
> Lager...", published previously)
> 
> Cheers,
>   Wills.
> 
> To follow:
> 	[PATCH 1/3] ARM: shmobile: lager dts: Add entries for VIN HDMI input
> 	[PATCH 2/3] media: adv7604: automatic "default-input" selection
> 	[PATCH 3/3] ARM: shmobile: lager dts: specify default-input for

I am wondering about the status of patch 2 of the series,
is it queued-up anywhere?

I am also wondering about the relationship between patch 2 and 3.
Does 3 work without 2? Does 2 make 3 unnecessary?

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

* Re: [Linux-kernel] Renesas Lager: Device Tree entries for VIN HDMI input, version 2
  2015-08-13 11:36 Renesas Lager: Device Tree entries for VIN HDMI input, version 2 William Towle
                   ` (3 preceding siblings ...)
  2015-09-18  0:26 ` Renesas Lager: Device Tree entries for VIN HDMI input, version 2 Simon Horman
@ 2015-09-22 16:36 ` William Towle
  4 siblings, 0 replies; 6+ messages in thread
From: William Towle @ 2015-09-22 16:36 UTC (permalink / raw)
  To: William Towle
  Cc: linux-media, linux-kernel, Hans Verkuil, Laurent Pinchart,
	Guennadi Liakhovetski, Sergei Shtylyov, Simon Horman, linux-sh

Hi Simon,

> On Thu, 13 Aug 2015, William Towle wrote:
> >  (Obsoletes corresponding parts of "HDMI and Composite capture on
> > Lager...", published previously)

> > To follow:
> > 	[PATCH 1/3] ARM: shmobile: lager dts: Add entries for VIN HDMI input
> > 	[PATCH 2/3] media: adv7604: automatic "default-input" selection
> > 	[PATCH 3/3] ARM: shmobile: lager dts: specify default-input for

> I am wondering about the status of patch 2 of the series,
> is it queued-up anywhere?

   All of these are effectively new, although the first and third
debuted in another thread. The patchwork link for the latter (at
https://patchwork.linuxtv.org/patch/30707/) contains the discussion
that led to the above being separated out.


> I am also wondering about the relationship between patch 2 and 3.
> Does 3 work without 2? Does 2 make 3 unnecessary?

   The device tree change in patch 3 is from Ian Molton's original
submissions, and works regardless of whether patch 2 is alongside it
or not.

   As far as the automatic port selection goes, patch 2 is related to
the argument made in commit 7111cdd ("[media] media: adv7604: reduce
support to first (digital) input") that since cable detect doesn't
work for port B, the .max_port property for boards using an ADV7612
should be ADV76XX_PAD_HDMI_PORT_A and we can use this to configure
port A as the default where there is not also an entry to specify it
in the device tree.
   If support for port B were available [in future], no action would
be taken where an ADV7612 is present and one would need to arrange
for applications in userland to actively make a choice where the
device tree does not have an appropriate value. In our particular case
we don't differentiate between hardware with ADV7611/7612 in the test
suite, and this necessitates having port selection available in the
device tree.

   Laurent may wish to comment further; for earlier discussion, see
https://patchwork.linuxtv.org/patch/30707/

Cheers,
   Wills.

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

end of thread, other threads:[~2015-09-22 16:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-13 11:36 Renesas Lager: Device Tree entries for VIN HDMI input, version 2 William Towle
2015-08-13 11:36 ` [PATCH 1/3] ARM: shmobile: lager dts: Add entries for VIN HDMI input support William Towle
2015-08-13 11:36 ` [PATCH 2/3] media: adv7604: automatic "default-input" selection William Towle
2015-08-13 11:36 ` [PATCH 3/3] ARM: shmobile: lager dts: specify default-input for ADV7612 William Towle
2015-09-18  0:26 ` Renesas Lager: Device Tree entries for VIN HDMI input, version 2 Simon Horman
2015-09-22 16:36 ` [Linux-kernel] " William Towle

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