Re: [PATCH 2/2] media: adv7604: automatic "default-input" selection

2016-09-22 Thread Ulrich Hecht
On Fri, Sep 16, 2016 at 11:57 AM, Laurent Pinchart
 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 .
>>
>> Signed-off-by: Ulrich Hecht 
>> Signed-off-by: Hans Verkuil 
>> ---
>>  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", ))
>
> 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


Re: [PATCH 2/2] media: adv7604: automatic "default-input" selection

2016-09-16 Thread Laurent Pinchart
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 .
> 
> Signed-off-by: Ulrich Hecht 
> Signed-off-by: Hans Verkuil 
> ---
>  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", ))

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", ))
> + state->pdata.default_input = v;
> +
>   flags = bus_cfg.bus.parallel.flags;
> 
>   if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)

-- 
Regards,

Laurent Pinchart



[PATCH 2/2] media: adv7604: automatic "default-input" selection

2016-09-16 Thread Ulrich Hecht
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 .

Signed-off-by: Ulrich Hecht 
Signed-off-by: Hans Verkuil 
---
 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", ))
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", ))
+   state->pdata.default_input = v;
+
flags = bus_cfg.bus.parallel.flags;
 
if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
-- 
2.9.3