All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] media: OF: add field-active and sync-on-green endpoint properties
@ 2013-05-15 12:52 Lad Prabhakar
  2013-05-15 13:24 ` Laurent Pinchart
  2013-05-16 10:45 ` Sylwester Nawrocki
  0 siblings, 2 replies; 7+ messages in thread
From: Lad Prabhakar @ 2013-05-15 12:52 UTC (permalink / raw)
  To: LMML
  Cc: LKML, DLOS, Lad, Prabhakar, Hans Verkuil, Laurent Pinchart,
	Mauro Carvalho Chehab, Guennadi Liakhovetski, Sylwester Nawrocki,
	Sakari Ailus, Grant Likely, Rob Herring, Rob Landley,
	devicetree-discuss, linux-doc, Kyungmin Park

From: Lad, Prabhakar <prabhakar.csengg@gmail.com>

This patch adds "field-active" and "sync-on-green" as part of
endpoint properties and also support to parse them in the parser.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Rob Landley <rob@landley.net>
Cc: devicetree-discuss@lists.ozlabs.org
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: davinci-linux-open-source@linux.davincidsp.com
Cc: Kyungmin Park <kyungmin.park@samsung.com>
---
 .../devicetree/bindings/media/video-interfaces.txt |    4 ++++
 drivers/media/v4l2-core/v4l2-of.c                  |    6 ++++++
 include/media/v4l2-mediabus.h                      |    2 ++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
index e022d2d..6bf87d0 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.txt
+++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
@@ -101,6 +101,10 @@ Optional endpoint properties
   array contains only one entry.
 - clock-noncontinuous: a boolean property to allow MIPI CSI-2 non-continuous
   clock mode.
+-field-active: a boolean property indicating active high filed ID output
+ polarity is inverted.
+-sync-on-green: a boolean property indicating to sync with the green signal in
+ RGB.
 
 
 Example
diff --git a/drivers/media/v4l2-core/v4l2-of.c b/drivers/media/v4l2-core/v4l2-of.c
index aa59639..1d59455 100644
--- a/drivers/media/v4l2-core/v4l2-of.c
+++ b/drivers/media/v4l2-core/v4l2-of.c
@@ -100,6 +100,12 @@ static void v4l2_of_parse_parallel_bus(const struct device_node *node,
 	if (!of_property_read_u32(node, "data-shift", &v))
 		bus->data_shift = v;
 
+	if (of_get_property(node, "field-active", &v))
+		flags |= V4L2_MBUS_FIELD_ACTIVE;
+
+	if (of_get_property(node, "sync-on-green", &v))
+		flags |= V4L2_MBUS_SOG;
+
 	bus->flags = flags;
 
 }
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 83ae07e..b95553d 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -40,6 +40,8 @@
 #define V4L2_MBUS_FIELD_EVEN_HIGH		(1 << 10)
 /* FIELD = 1/0 - Field1 (odd)/Field2 (even) */
 #define V4L2_MBUS_FIELD_EVEN_LOW		(1 << 11)
+#define V4L2_MBUS_FIELD_ACTIVE			(1 << 12)
+#define V4L2_MBUS_SOG				(1 << 13)
 
 /* Serial flags */
 /* How many lanes the client can use */
-- 
1.7.4.1


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

* Re: [PATCH RFC] media: OF: add field-active and sync-on-green endpoint properties
  2013-05-15 12:52 [PATCH RFC] media: OF: add field-active and sync-on-green endpoint properties Lad Prabhakar
@ 2013-05-15 13:24 ` Laurent Pinchart
  2013-05-16  4:53   ` Prabhakar Lad
  2013-05-16 10:45 ` Sylwester Nawrocki
  1 sibling, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2013-05-15 13:24 UTC (permalink / raw)
  To: Lad Prabhakar
  Cc: LMML, LKML, DLOS, Hans Verkuil, Mauro Carvalho Chehab,
	Guennadi Liakhovetski, Sylwester Nawrocki, Sakari Ailus,
	Grant Likely, Rob Herring, Rob Landley, devicetree-discuss,
	linux-doc, Kyungmin Park

Hi Prabhakar,

Thank you for the patch.

On Wednesday 15 May 2013 18:22:29 Lad Prabhakar wrote:
> From: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> 
> This patch adds "field-active" and "sync-on-green" as part of
> endpoint properties and also support to parse them in the parser.
> 
> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> Cc: Hans Verkuil <hans.verkuil@cisco.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Cc: Sakari Ailus <sakari.ailus@iki.fi>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Rob Landley <rob@landley.net>
> Cc: devicetree-discuss@lists.ozlabs.org
> Cc: linux-doc@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: davinci-linux-open-source@linux.davincidsp.com
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  .../devicetree/bindings/media/video-interfaces.txt |    4 ++++
>  drivers/media/v4l2-core/v4l2-of.c                  |    6 ++++++
>  include/media/v4l2-mediabus.h                      |    2 ++
>  3 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt
> b/Documentation/devicetree/bindings/media/video-interfaces.txt index
> e022d2d..6bf87d0 100644
> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> @@ -101,6 +101,10 @@ Optional endpoint properties
>    array contains only one entry.
>  - clock-noncontinuous: a boolean property to allow MIPI CSI-2
> non-continuous clock mode.
> +-field-active: a boolean property indicating active high filed ID output
> + polarity is inverted.

Looks like we already have field-even-active property to describe the level of 
the field signal. Could you please check whether it fulfills your use cases ? 
Sorry for not pointing you to it earlier.

> +-sync-on-green: a boolean property indicating to sync with the green signal
> in + RGB.
> 
> 
>  Example
> diff --git a/drivers/media/v4l2-core/v4l2-of.c
> b/drivers/media/v4l2-core/v4l2-of.c index aa59639..1d59455 100644
> --- a/drivers/media/v4l2-core/v4l2-of.c
> +++ b/drivers/media/v4l2-core/v4l2-of.c
> @@ -100,6 +100,12 @@ static void v4l2_of_parse_parallel_bus(const struct
> device_node *node, if (!of_property_read_u32(node, "data-shift", &v))
>  		bus->data_shift = v;
> 
> +	if (of_get_property(node, "field-active", &v))
> +		flags |= V4L2_MBUS_FIELD_ACTIVE;
> +
> +	if (of_get_property(node, "sync-on-green", &v))
> +		flags |= V4L2_MBUS_SOG;
> +
>  	bus->flags = flags;
> 
>  }
> diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
> index 83ae07e..b95553d 100644
> --- a/include/media/v4l2-mediabus.h
> +++ b/include/media/v4l2-mediabus.h
> @@ -40,6 +40,8 @@
>  #define V4L2_MBUS_FIELD_EVEN_HIGH		(1 << 10)
>  /* FIELD = 1/0 - Field1 (odd)/Field2 (even) */
>  #define V4L2_MBUS_FIELD_EVEN_LOW		(1 << 11)
> +#define V4L2_MBUS_FIELD_ACTIVE			(1 << 12)
> +#define V4L2_MBUS_SOG				(1 << 13)
> 
>  /* Serial flags */
>  /* How many lanes the client can use */
-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH RFC] media: OF: add field-active and sync-on-green endpoint properties
  2013-05-15 13:24 ` Laurent Pinchart
@ 2013-05-16  4:53   ` Prabhakar Lad
  2013-05-16 10:43     ` Sylwester Nawrocki
  0 siblings, 1 reply; 7+ messages in thread
From: Prabhakar Lad @ 2013-05-16  4:53 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: LMML, LKML, DLOS, Hans Verkuil, Mauro Carvalho Chehab,
	Guennadi Liakhovetski, Sylwester Nawrocki, Sakari Ailus,
	Grant Likely, Rob Herring, Rob Landley, devicetree-discuss,
	linux-doc, Kyungmin Park

Hi Laurent,

On Wed, May 15, 2013 at 6:54 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Prabhakar,
>
> Thank you for the patch.
>
> On Wednesday 15 May 2013 18:22:29 Lad Prabhakar wrote:
>> From: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>>
>> This patch adds "field-active" and "sync-on-green" as part of
>> endpoint properties and also support to parse them in the parser.
>>
>> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>> Cc: Hans Verkuil <hans.verkuil@cisco.com>
>> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
>> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
>> Cc: Sakari Ailus <sakari.ailus@iki.fi>
>> Cc: Grant Likely <grant.likely@secretlab.ca>
>> Cc: Rob Herring <rob.herring@calxeda.com>
>> Cc: Rob Landley <rob@landley.net>
>> Cc: devicetree-discuss@lists.ozlabs.org
>> Cc: linux-doc@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
>> Cc: davinci-linux-open-source@linux.davincidsp.com
>> Cc: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>  .../devicetree/bindings/media/video-interfaces.txt |    4 ++++
>>  drivers/media/v4l2-core/v4l2-of.c                  |    6 ++++++
>>  include/media/v4l2-mediabus.h                      |    2 ++
>>  3 files changed, 12 insertions(+), 0 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt
>> b/Documentation/devicetree/bindings/media/video-interfaces.txt index
>> e022d2d..6bf87d0 100644
>> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
>> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
>> @@ -101,6 +101,10 @@ Optional endpoint properties
>>    array contains only one entry.
>>  - clock-noncontinuous: a boolean property to allow MIPI CSI-2
>> non-continuous clock mode.
>> +-field-active: a boolean property indicating active high filed ID output
>> + polarity is inverted.
>
> Looks like we already have field-even-active property to describe the level of
> the field signal. Could you please check whether it fulfills your use cases ?
> Sorry for not pointing you to it earlier.
>
I had looked at it earlier it only means "field signal level during the even
field data transmission" it only speaks of even filed. Ideally the field ID
output is set to logic 1 for odd field and set to 0 for even field, what I
want is to invert the FID out polarity when "field-active" property is set.

May be we rename "field-active" to "fid-pol" ?

Regards,
--Prabhakar Lad

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

* Re: [PATCH RFC] media: OF: add field-active and sync-on-green endpoint properties
  2013-05-16  4:53   ` Prabhakar Lad
@ 2013-05-16 10:43     ` Sylwester Nawrocki
  2013-05-16 10:52       ` Prabhakar Lad
  0 siblings, 1 reply; 7+ messages in thread
From: Sylwester Nawrocki @ 2013-05-16 10:43 UTC (permalink / raw)
  To: Prabhakar Lad
  Cc: Laurent Pinchart, LMML, LKML, DLOS, Hans Verkuil,
	Mauro Carvalho Chehab, Guennadi Liakhovetski, Sakari Ailus,
	Grant Likely, Rob Herring, Rob Landley, devicetree-discuss,
	linux-doc, Kyungmin Park

Hi,

On 05/16/2013 06:53 AM, Prabhakar Lad wrote:
>>> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt
>>> >>  b/Documentation/devicetree/bindings/media/video-interfaces.txt index
>>> >>  e022d2d..6bf87d0 100644
>>> >>  --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
>>> >>  +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
>>> >>  @@ -101,6 +101,10 @@ Optional endpoint properties
>>> >>      array contains only one entry.
>>> >>    - clock-noncontinuous: a boolean property to allow MIPI CSI-2
>>> >>  non-continuous clock mode.
>>> >>  +-field-active: a boolean property indicating active high filed ID output
>>> >>  + polarity is inverted.
>> >
>> >  Looks like we already have field-even-active property to describe the level of
>> >  the field signal. Could you please check whether it fulfills your use cases ?
>> >  Sorry for not pointing you to it earlier.
>> >
> I had looked at it earlier it only means "field signal level during the even
> field data transmission" it only speaks of even filed. Ideally the field ID
> output is set to logic 1 for odd field and set to 0 for even field, what I
> want is to invert the FID out polarity when "field-active" property is set.
>
> May be we rename "field-active" to "fid-pol" ?

I guess we failed to clearly describe the 'field-even-active' property then.
It seems to be exactly what you need.

It is not enough to say e.g. field-active = <1>;, because it would not have
been clear which field it refers to, odd or even ? Unlike VSYNC, HSYNC both
levels of the FIELD signal are "active", there is no "idle" state for FIELD.

So field-even-active = <1>; means the FIELD signal at logic high level
indicates EVEN field _and_ this implies FIELD = 0 indicates ODD field, i.e.

FIELD = 0 => odd field
FIELD = 1 => even field

For field-even-active = <0>; it is the other way around:

FIELD = 0 => even field
FIELD = 1 => odd field

It looks like only "sync-on-green" property is missing. BTW, is it really
commonly used ? What drivers would need it ?
I'm not against making it a common property, it's just first time I see it.

Thanks,
Sylwester

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

* Re: [PATCH RFC] media: OF: add field-active and sync-on-green endpoint properties
  2013-05-15 12:52 [PATCH RFC] media: OF: add field-active and sync-on-green endpoint properties Lad Prabhakar
  2013-05-15 13:24 ` Laurent Pinchart
@ 2013-05-16 10:45 ` Sylwester Nawrocki
  2013-05-16 10:54   ` Prabhakar Lad
  1 sibling, 1 reply; 7+ messages in thread
From: Sylwester Nawrocki @ 2013-05-16 10:45 UTC (permalink / raw)
  To: Lad Prabhakar
  Cc: LMML, LKML, DLOS, Hans Verkuil, Laurent Pinchart,
	Mauro Carvalho Chehab, Guennadi Liakhovetski, Sylwester Nawrocki,
	Sakari Ailus, Grant Likely, Rob Herring, Rob Landley,
	devicetree-discuss, linux-doc, Kyungmin Park

On 05/15/2013 02:52 PM, Lad Prabhakar wrote:
> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> index e022d2d..6bf87d0 100644
> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> @@ -101,6 +101,10 @@ Optional endpoint properties
>     array contains only one entry.
>   - clock-noncontinuous: a boolean property to allow MIPI CSI-2 non-continuous
>     clock mode.
> +-field-active: a boolean property indicating active high filed ID output
> + polarity is inverted.

You can drop this property and use the existing 'field-even-active' property
instead.

> +-sync-on-green: a boolean property indicating to sync with the green signal in
> + RGB.

> diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
> index 83ae07e..b95553d 100644
> --- a/include/media/v4l2-mediabus.h
> +++ b/include/media/v4l2-mediabus.h
> @@ -40,6 +40,8 @@
>   #define V4L2_MBUS_FIELD_EVEN_HIGH		(1<<  10)
>   /* FIELD = 1/0 - Field1 (odd)/Field2 (even) */
>   #define V4L2_MBUS_FIELD_EVEN_LOW		(1<<  11)
> +#define V4L2_MBUS_FIELD_ACTIVE			(1<<  12)
> +#define V4L2_MBUS_SOG				(1<<  13)

How about V4L2_MBUS_SYNC_ON_GREEN ?

Thanks,
Sylwester

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

* Re: [PATCH RFC] media: OF: add field-active and sync-on-green endpoint properties
  2013-05-16 10:43     ` Sylwester Nawrocki
@ 2013-05-16 10:52       ` Prabhakar Lad
  0 siblings, 0 replies; 7+ messages in thread
From: Prabhakar Lad @ 2013-05-16 10:52 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: Laurent Pinchart, LMML, LKML, DLOS, Hans Verkuil,
	Mauro Carvalho Chehab, Guennadi Liakhovetski, Sakari Ailus,
	Grant Likely, Rob Herring, Rob Landley, devicetree-discuss,
	linux-doc, Kyungmin Park

Hi Sylwester,

On Thu, May 16, 2013 at 4:13 PM, Sylwester Nawrocki
<sylvester.nawrocki@gmail.com> wrote:
> Hi,
>
>
> On 05/16/2013 06:53 AM, Prabhakar Lad wrote:
>>>>
[Snip]
>> May be we rename "field-active" to "fid-pol" ?
>
>
> I guess we failed to clearly describe the 'field-even-active' property then.
> It seems to be exactly what you need.
>
> It is not enough to say e.g. field-active = <1>;, because it would not have
> been clear which field it refers to, odd or even ? Unlike VSYNC, HSYNC both
> levels of the FIELD signal are "active", there is no "idle" state for FIELD.
>
> So field-even-active = <1>; means the FIELD signal at logic high level
> indicates EVEN field _and_ this implies FIELD = 0 indicates ODD field, i.e.
>
> FIELD = 0 => odd field
> FIELD = 1 => even field
>
> For field-even-active = <0>; it is the other way around:
>
> FIELD = 0 => even field
> FIELD = 1 => odd field
>
Thanks that makes it clear :)

> It looks like only "sync-on-green" property is missing. BTW, is it really
> commonly used ? What drivers would need it ?
> I'm not against making it a common property, it's just first time I see it.
>
I have comes across a decoder tvp7002 which uses it, may be Laurent/Hans/Sakari
may point much more devices.

Regards,
--Prabhakar Lad

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

* Re: [PATCH RFC] media: OF: add field-active and sync-on-green endpoint properties
  2013-05-16 10:45 ` Sylwester Nawrocki
@ 2013-05-16 10:54   ` Prabhakar Lad
  0 siblings, 0 replies; 7+ messages in thread
From: Prabhakar Lad @ 2013-05-16 10:54 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: LMML, LKML, DLOS, Hans Verkuil, Laurent Pinchart,
	Mauro Carvalho Chehab, Guennadi Liakhovetski, Sylwester Nawrocki,
	Sakari Ailus, Grant Likely, Rob Herring, Rob Landley,
	devicetree-discuss, linux-doc, Kyungmin Park

Hi Sylwester,

Thanks for the review.

On Thu, May 16, 2013 at 4:15 PM, Sylwester Nawrocki
<sylvester.nawrocki@gmail.com> wrote:
> On 05/15/2013 02:52 PM, Lad Prabhakar wrote:
>>
>> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt
>> b/Documentation/devicetree/bindings/media/video-interfaces.txt
>> index e022d2d..6bf87d0 100644
>> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
>> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
>> @@ -101,6 +101,10 @@ Optional endpoint properties
>>     array contains only one entry.
>>   - clock-noncontinuous: a boolean property to allow MIPI CSI-2
>> non-continuous
>>     clock mode.
>> +-field-active: a boolean property indicating active high filed ID output
>> + polarity is inverted.
>
>
> You can drop this property and use the existing 'field-even-active' property
> instead.
>
OK

>
>> +-sync-on-green: a boolean property indicating to sync with the green
>> signal in
>> + RGB.
>
>
>> diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
>> index 83ae07e..b95553d 100644
>> --- a/include/media/v4l2-mediabus.h
>> +++ b/include/media/v4l2-mediabus.h
>> @@ -40,6 +40,8 @@
>>   #define V4L2_MBUS_FIELD_EVEN_HIGH             (1<<  10)
>>   /* FIELD = 1/0 - Field1 (odd)/Field2 (even) */
>>   #define V4L2_MBUS_FIELD_EVEN_LOW              (1<<  11)
>> +#define V4L2_MBUS_FIELD_ACTIVE                 (1<<  12)
>> +#define V4L2_MBUS_SOG                          (1<<  13)
>
>
> How about V4L2_MBUS_SYNC_ON_GREEN ?
>
OK makes it more readable.

Regards,
--Prabhakar Lad

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

end of thread, other threads:[~2013-05-16 10:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-15 12:52 [PATCH RFC] media: OF: add field-active and sync-on-green endpoint properties Lad Prabhakar
2013-05-15 13:24 ` Laurent Pinchart
2013-05-16  4:53   ` Prabhakar Lad
2013-05-16 10:43     ` Sylwester Nawrocki
2013-05-16 10:52       ` Prabhakar Lad
2013-05-16 10:45 ` Sylwester Nawrocki
2013-05-16 10:54   ` Prabhakar Lad

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.