linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] media: adv7604: fix default-input property inconsistencies
@ 2016-09-16  9:39 Ulrich Hecht
  2016-09-16  9:39 ` [PATCH 1/2] media: adv7604: fix bindings inconsistency for default-input Ulrich Hecht
  2016-09-16  9:39 ` [PATCH 2/2] media: adv7604: automatic "default-input" selection Ulrich Hecht
  0 siblings, 2 replies; 6+ messages in thread
From: Ulrich Hecht @ 2016-09-16  9:39 UTC (permalink / raw)
  To: hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm,
	ulrich.hecht+renesas, laurent.pinchart, william.towle,
	devicetree

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.

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                             | 5 ++++-
 2 files changed, 5 insertions(+), 3 deletions(-)

-- 
2.9.3


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

* [PATCH 1/2] media: adv7604: fix bindings inconsistency for default-input
  2016-09-16  9:39 [PATCH 0/2] media: adv7604: fix default-input property inconsistencies Ulrich Hecht
@ 2016-09-16  9:39 ` Ulrich Hecht
  2016-09-16  9:54   ` Laurent Pinchart
  2016-09-16  9:39 ` [PATCH 2/2] media: adv7604: automatic "default-input" selection Ulrich Hecht
  1 sibling, 1 reply; 6+ messages in thread
From: Ulrich Hecht @ 2016-09-16  9:39 UTC (permalink / raw)
  To: hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm,
	ulrich.hecht+renesas, laurent.pinchart, william.towle,
	devicetree

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

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 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.9.3


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

* [PATCH 2/2] media: adv7604: automatic "default-input" selection
  2016-09-16  9:39 [PATCH 0/2] media: adv7604: fix default-input property inconsistencies Ulrich Hecht
  2016-09-16  9:39 ` [PATCH 1/2] media: adv7604: fix bindings inconsistency for default-input Ulrich Hecht
@ 2016-09-16  9:39 ` Ulrich Hecht
  2016-09-16  9:57   ` Laurent Pinchart
  1 sibling, 1 reply; 6+ messages in thread
From: Ulrich Hecht @ 2016-09-16  9:39 UTC (permalink / raw)
  To: hans.verkuil, niklas.soderlund
  Cc: linux-media, linux-renesas-soc, magnus.damm,
	ulrich.hecht+renesas, laurent.pinchart, william.towle,
	devicetree

Fall back to input 0 if "default-input" property is not present.

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

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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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


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

* Re: [PATCH 1/2] media: adv7604: fix bindings inconsistency for default-input
  2016-09-16  9:39 ` [PATCH 1/2] media: adv7604: fix bindings inconsistency for default-input Ulrich Hecht
@ 2016-09-16  9:54   ` Laurent Pinchart
  0 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2016-09-16  9:54 UTC (permalink / raw)
  To: Ulrich Hecht
  Cc: hans.verkuil, niklas.soderlund, linux-media, linux-renesas-soc,
	magnus.damm, william.towle, devicetree

Hi Ulrich,

Thank you for the patch.

On Friday 16 Sep 2016 11:39:41 Ulrich Hecht wrote:
> The text states that default-input is an endpoint property, but in the
> example it is a device property.  The example makes more sense.

You should explain why it makes more sense. Something along the lines of

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

With that changed,

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

> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> ---
>  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 {

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH 2/2] media: adv7604: automatic "default-input" selection
  2016-09-16  9:39 ` [PATCH 2/2] media: adv7604: automatic "default-input" selection Ulrich Hecht
@ 2016-09-16  9:57   ` Laurent Pinchart
  2016-09-22 13:17     ` Ulrich Hecht
  0 siblings, 1 reply; 6+ messages in thread
From: Laurent Pinchart @ 2016-09-16  9:57 UTC (permalink / raw)
  To: Ulrich Hecht
  Cc: hans.verkuil, niklas.soderlund, linux-media, linux-renesas-soc,
	magnus.damm, william.towle, devicetree

Hi Ulrich,

Thank you for the patch.

On Friday 16 Sep 2016 11:39:42 Ulrich Hecht wrote:
> Fall back to input 0 if "default-input" property is not present.
> 
> Documentation states that the "default-input" property should reside
> directly in the node for adv7612.

Not just fo adv7612.

> Hence, also adjust the parsing to make the implementation consistent with
> this.
> 
> 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 | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
> index 4003831..055c9df 100644
> --- a/drivers/media/i2c/adv7604.c
> +++ b/drivers/media/i2c/adv7604.c
> @@ -3077,10 +3077,13 @@ static int adv76xx_parse_dt(struct adv76xx_state
> *state)
> 	if (!of_property_read_u32(endpoint, "default-input", &v))

Should this be removed if the property has to be in the device node and not in 
the endpoint ?

>  		state->pdata.default_input = v;
>  	else
> -		state->pdata.default_input = -1;
> +		state->pdata.default_input = 0;

What was the use case for setting it to -1 ? Is it safe to change that ?

>  	of_node_put(endpoint);
> 
> +	if (!of_property_read_u32(np, "default-input", &v))
> +		state->pdata.default_input = v;
> +
>  	flags = bus_cfg.bus.parallel.flags;
> 
>  	if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH 2/2] media: adv7604: automatic "default-input" selection
  2016-09-16  9:57   ` Laurent Pinchart
@ 2016-09-22 13:17     ` Ulrich Hecht
  0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Hecht @ 2016-09-22 13:17 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: hans.verkuil, Niklas Söderlund, Linux Media Mailing List,
	Linux-Renesas, Magnus Damm, William Towle, devicetree

On Fri, Sep 16, 2016 at 11:57 AM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Ulrich,
>
> Thank you for the patch.

Thanks for your review.

>
> On Friday 16 Sep 2016 11:39:42 Ulrich Hecht wrote:
>> Fall back to input 0 if "default-input" property is not present.
>>
>> Documentation states that the "default-input" property should reside
>> directly in the node for adv7612.
>
> Not just fo adv7612.
>
>> Hence, also adjust the parsing to make the implementation consistent with
>> this.
>>
>> 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 | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
>> index 4003831..055c9df 100644
>> --- a/drivers/media/i2c/adv7604.c
>> +++ b/drivers/media/i2c/adv7604.c
>> @@ -3077,10 +3077,13 @@ static int adv76xx_parse_dt(struct adv76xx_state
>> *state)
>>       if (!of_property_read_u32(endpoint, "default-input", &v))
>
> Should this be removed if the property has to be in the device node and not in
> the endpoint ?

Probably, considering it's not used anywhere yet.

>
>>               state->pdata.default_input = v;
>>       else
>> -             state->pdata.default_input = -1;
>> +             state->pdata.default_input = 0;
>
> What was the use case for setting it to -1 ? Is it safe to change that ?

Not sure. Might as well leave it at -1, we define the default in the DT anyway.

CU
Uli

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

end of thread, other threads:[~2016-09-22 13:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-16  9:39 [PATCH 0/2] media: adv7604: fix default-input property inconsistencies Ulrich Hecht
2016-09-16  9:39 ` [PATCH 1/2] media: adv7604: fix bindings inconsistency for default-input Ulrich Hecht
2016-09-16  9:54   ` Laurent Pinchart
2016-09-16  9:39 ` [PATCH 2/2] media: adv7604: automatic "default-input" selection Ulrich Hecht
2016-09-16  9:57   ` Laurent Pinchart
2016-09-22 13:17     ` Ulrich Hecht

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