devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] media: adv7604: fix default-input property inconsistencies
@ 2016-09-22 13:18 Ulrich Hecht
       [not found] ` <1474550340-31455-1-git-send-email-ulrich.hecht+renesas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2016-09-22 13:19 ` [PATCH v2 2/2] media: adv7604: automatic "default-input" selection Ulrich Hecht
  0 siblings, 2 replies; 5+ messages in thread
From: Ulrich Hecht @ 2016-09-22 13:18 UTC (permalink / raw)
  To: hans.verkuil
  Cc: niklas.soderlund, linux-media, linux-renesas-soc, magnus.damm,
	ulrich.hecht+renesas, laurent.pinchart, william.towle, devicetree,
	radhey.shyam.pandey

Hi!

This is a fix for the inconsistency in the adv7604 bindings regarding the
default-input property, clarifying that it should be a property of the
device, not the endpoint, and a patch to implement it.

This revision implements Laurent's suggestions:

- The default input should not be set if the default-input property is missing.
- The old code for parsing the property in the endpoint node can be removed.
- The rationale for the change should go in the commit message.

CU
Uli


Ulrich Hecht (2):
  media: adv7604: fix bindings inconsistency for default-input
  media: adv7604: automatic "default-input" selection

 Documentation/devicetree/bindings/media/i2c/adv7604.txt | 3 +--
 drivers/media/i2c/adv7604.c                             | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)

-- 
2.7.4

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

* [PATCH v2 1/2] media: adv7604: fix bindings inconsistency for default-input
       [not found] ` <1474550340-31455-1-git-send-email-ulrich.hecht+renesas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-09-22 13:18   ` Ulrich Hecht
  2016-09-23 20:03     ` Rob Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Ulrich Hecht @ 2016-09-22 13:18 UTC (permalink / raw)
  To: hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w
  Cc: niklas.soderlund-1zkq55x86MTxsAP9Fp7wbw,
	linux-media-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	magnus.damm-Re5JQEeQqe8AvxtiuMwx3w,
	ulrich.hecht+renesas-Re5JQEeQqe8AvxtiuMwx3w,
	laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw,
	william.towle-4yDnlxn2s6sWdaTGBSpHTA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	radhey.shyam.pandey-gjFFaj9aHVfQT0dZR+AlfA

The text states that default-input is an endpoint property, but in the
example it is a device property.

The default input is a property of the chip, not of a particular port, so
the example makes more sense.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
---
 Documentation/devicetree/bindings/media/i2c/adv7604.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/i2c/adv7604.txt b/Documentation/devicetree/bindings/media/i2c/adv7604.txt
index 8337f75..9cbd92e 100644
--- a/Documentation/devicetree/bindings/media/i2c/adv7604.txt
+++ b/Documentation/devicetree/bindings/media/i2c/adv7604.txt
@@ -34,6 +34,7 @@ The digital output port node must contain at least one endpoint.
 Optional Properties:
 
   - reset-gpios: Reference to the GPIO connected to the device's reset pin.
+  - default-input: Select which input is selected after reset.
 
 Optional Endpoint Properties:
 
@@ -47,8 +48,6 @@ Optional Endpoint Properties:
   If none of hsync-active, vsync-active and pclk-sample is specified the
   endpoint will use embedded BT.656 synchronization.
 
-  - default-input: Select which input is selected after reset.
-
 Example:
 
 	hdmi_receiver@4c {
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v2 2/2] media: adv7604: automatic "default-input" selection
  2016-09-22 13:18 [PATCH v2 0/2] media: adv7604: fix default-input property inconsistencies Ulrich Hecht
       [not found] ` <1474550340-31455-1-git-send-email-ulrich.hecht+renesas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-09-22 13:19 ` Ulrich Hecht
  2016-09-26  8:31   ` Laurent Pinchart
  1 sibling, 1 reply; 5+ messages in thread
From: Ulrich Hecht @ 2016-09-22 13:19 UTC (permalink / raw)
  To: hans.verkuil
  Cc: niklas.soderlund, linux-media, linux-renesas-soc, magnus.damm,
	ulrich.hecht+renesas, laurent.pinchart, william.towle, devicetree,
	radhey.shyam.pandey

Documentation states that the "default-input" property should reside
directly in the node of the device.  This adjusts the parsing to make the
implementation consistent with the documentation.

Based on patch by William Towle <william.towle@codethink.co.uk>.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/i2c/adv7604.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 4003831..fa7046e 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -3074,13 +3074,13 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
 		return ret;
 	}
 
-	if (!of_property_read_u32(endpoint, "default-input", &v))
+	of_node_put(endpoint);
+
+	if (!of_property_read_u32(np, "default-input", &v))
 		state->pdata.default_input = v;
 	else
 		state->pdata.default_input = -1;
 
-	of_node_put(endpoint);
-
 	flags = bus_cfg.bus.parallel.flags;
 
 	if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
-- 
2.7.4

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

* Re: [PATCH v2 1/2] media: adv7604: fix bindings inconsistency for default-input
  2016-09-22 13:18   ` [PATCH v2 1/2] media: adv7604: fix bindings inconsistency for default-input Ulrich Hecht
@ 2016-09-23 20:03     ` Rob Herring
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2016-09-23 20:03 UTC (permalink / raw)
  To: Ulrich Hecht
  Cc: hans.verkuil, niklas.soderlund, linux-media, linux-renesas-soc,
	magnus.damm, laurent.pinchart, william.towle, devicetree,
	radhey.shyam.pandey

On Thu, Sep 22, 2016 at 03:18:59PM +0200, Ulrich Hecht wrote:
> The text states that default-input is an endpoint property, but in the
> example it is a device property.
> 
> The default input is a property of the chip, not of a particular port, so
> the example makes more sense.
> 
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  Documentation/devicetree/bindings/media/i2c/adv7604.txt | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

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

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

* Re: [PATCH v2 2/2] media: adv7604: automatic "default-input" selection
  2016-09-22 13:19 ` [PATCH v2 2/2] media: adv7604: automatic "default-input" selection Ulrich Hecht
@ 2016-09-26  8:31   ` Laurent Pinchart
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2016-09-26  8:31 UTC (permalink / raw)
  To: Ulrich Hecht
  Cc: hans.verkuil, niklas.soderlund, linux-media, linux-renesas-soc,
	magnus.damm, william.towle, devicetree, radhey.shyam.pandey

Hi Ulrich,

Thank you for the patch.

On Thursday 22 Sep 2016 15:19:00 Ulrich Hecht wrote:
> Documentation states that the "default-input" property should reside
> directly in the node of the device.  This adjusts the parsing to make the
> implementation consistent with the documentation.
> 
> Based on patch by William Towle <william.towle@codethink.co.uk>.
> 
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/i2c/adv7604.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
> index 4003831..fa7046e 100644
> --- a/drivers/media/i2c/adv7604.c
> +++ b/drivers/media/i2c/adv7604.c
> @@ -3074,13 +3074,13 @@ static int adv76xx_parse_dt(struct adv76xx_state
> *state) return ret;
>  	}
> 
> -	if (!of_property_read_u32(endpoint, "default-input", &v))
> +	of_node_put(endpoint);
> +
> +	if (!of_property_read_u32(np, "default-input", &v))
>  		state->pdata.default_input = v;
>  	else
>  		state->pdata.default_input = -1;
> 
> -	of_node_put(endpoint);
> -
>  	flags = bus_cfg.bus.parallel.flags;
> 
>  	if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2016-09-26  8:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-22 13:18 [PATCH v2 0/2] media: adv7604: fix default-input property inconsistencies Ulrich Hecht
     [not found] ` <1474550340-31455-1-git-send-email-ulrich.hecht+renesas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-09-22 13:18   ` [PATCH v2 1/2] media: adv7604: fix bindings inconsistency for default-input Ulrich Hecht
2016-09-23 20:03     ` Rob Herring
2016-09-22 13:19 ` [PATCH v2 2/2] media: adv7604: automatic "default-input" selection Ulrich Hecht
2016-09-26  8:31   ` Laurent Pinchart

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