devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC v4] media: OF: add "sync-on-green-active" property
@ 2013-07-16 17:19 Prabhakar Lad
  2013-07-16 20:38 ` Sylwester Nawrocki
  0 siblings, 1 reply; 3+ messages in thread
From: Prabhakar Lad @ 2013-07-16 17:19 UTC (permalink / raw)
  To: LMML, devicetree-discuss
  Cc: DLOS, LKML, linux-doc, Sylwester Nawrocki, Lad, Prabhakar

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

This patch adds 'sync-on-green-active' property as part
of endpoint property.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
---
  Changes for v4:
  1: Fixed review comments pointed by Sylwester.
  
  Changes for v3:
  1: Fixed review comments pointed by Laurent and Sylwester.

  RFC v2 https://patchwork.kernel.org/patch/2578091/
  
  RFC V1 https://patchwork.kernel.org/patch/2572341/
  
 .../devicetree/bindings/media/video-interfaces.txt |    3 +++
 drivers/media/v4l2-core/v4l2-of.c                  |    4 ++++
 include/media/v4l2-mediabus.h                      |    2 ++
 3 files changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
index e022d2d..5186c7e 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.txt
+++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
@@ -101,6 +101,9 @@ Optional endpoint properties
   array contains only one entry.
 - clock-noncontinuous: a boolean property to allow MIPI CSI-2 non-continuous
   clock mode.
+- sync-on-green-active: polarity field when video synchronization is
+  Sync-On-Green. When set the driver determines whether it's a normal operation
+  or inverted operation.
 
 
 Example
diff --git a/drivers/media/v4l2-core/v4l2-of.c b/drivers/media/v4l2-core/v4l2-of.c
index aa59639..5c4c9f0 100644
--- a/drivers/media/v4l2-core/v4l2-of.c
+++ b/drivers/media/v4l2-core/v4l2-of.c
@@ -100,6 +100,10 @@ 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_property_read_u32(node, "sync-on-green-active", &v))
+		flags |= v ? V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH :
+			V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW;
+
 	bus->flags = flags;
 
 }
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 83ae07e..d47eb81 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_VIDEO_SOG_ACTIVE_HIGH	(1 << 12)
+#define V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW		(1 << 13)
 
 /* Serial flags */
 /* How many lanes the client can use */
-- 
1.7.9.5


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

* Re: [PATCH RFC v4] media: OF: add "sync-on-green-active" property
  2013-07-16 17:19 [PATCH RFC v4] media: OF: add "sync-on-green-active" property Prabhakar Lad
@ 2013-07-16 20:38 ` Sylwester Nawrocki
  2013-07-17  8:35   ` Prabhakar Lad
  0 siblings, 1 reply; 3+ messages in thread
From: Sylwester Nawrocki @ 2013-07-16 20:38 UTC (permalink / raw)
  To: Prabhakar Lad
  Cc: LMML, devicetree-discuss, DLOS, LKML, linux-doc,
	Sylwester Nawrocki

Hi Prabhakar,

On 07/16/2013 07:19 PM, Prabhakar Lad wrote:
> From: "Lad, Prabhakar"<prabhakar.csengg@gmail.com>
>
> This patch adds 'sync-on-green-active' property as part
> of endpoint property.
>
> Signed-off-by: Lad, Prabhakar<prabhakar.csengg@gmail.com>
> ---
>    Changes for v4:
>    1: Fixed review comments pointed by Sylwester.
>
>    Changes for v3:
>    1: Fixed review comments pointed by Laurent and Sylwester.
>
>    RFC v2 https://patchwork.kernel.org/patch/2578091/
>
>    RFC V1 https://patchwork.kernel.org/patch/2572341/
>
>   .../devicetree/bindings/media/video-interfaces.txt |    3 +++
>   drivers/media/v4l2-core/v4l2-of.c                  |    4 ++++
>   include/media/v4l2-mediabus.h                      |    2 ++
>   3 files changed, 9 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> index e022d2d..5186c7e 100644
> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> @@ -101,6 +101,9 @@ Optional endpoint properties
>     array contains only one entry.
>   - clock-noncontinuous: a boolean property to allow MIPI CSI-2 non-continuous
>     clock mode.
> +- sync-on-green-active: polarity field when video synchronization is
> +  Sync-On-Green. When set the driver determines whether it's a normal operation
> +  or inverted operation.

Would you mind adding this entry after pclk-sample property description ?
And how about describing it a bit more precisely and similarly to 
VSYNC/HSYNC,
e.g.

- sync-on-green-active: active state of Sync-on-green (SoG) signal,
   0/1 for LOW/HIGH respectively.

Otherwise looks good.

>   Example
> diff --git a/drivers/media/v4l2-core/v4l2-of.c b/drivers/media/v4l2-core/v4l2-of.c
> index aa59639..5c4c9f0 100644
> --- a/drivers/media/v4l2-core/v4l2-of.c
> +++ b/drivers/media/v4l2-core/v4l2-of.c
> @@ -100,6 +100,10 @@ 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_property_read_u32(node, "sync-on-green-active",&v))
> +		flags |= v ? V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH :
> +			V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW;
> +
>   	bus->flags = flags;
>
>   }
> diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
> index 83ae07e..d47eb81 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_VIDEO_SOG_ACTIVE_HIGH	(1<<  12)
> +#define V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW		(1<<  13)
>
>   /* Serial flags */
>   /* How many lanes the client can use */

Thanks,
Sylwester

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

* Re: [PATCH RFC v4] media: OF: add "sync-on-green-active" property
  2013-07-16 20:38 ` Sylwester Nawrocki
@ 2013-07-17  8:35   ` Prabhakar Lad
  0 siblings, 0 replies; 3+ messages in thread
From: Prabhakar Lad @ 2013-07-17  8:35 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: LMML, devicetree-discuss, DLOS, LKML, linux-doc,
	Sylwester Nawrocki

Hi Sylwester,

Thanks for the review.

On Wed, Jul 17, 2013 at 2:08 AM, Sylwester Nawrocki
<sylvester.nawrocki@gmail.com> wrote:
> Hi Prabhakar,
>
>
[snip]
>> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt
>> b/Documentation/devicetree/bindings/media/video-interfaces.txt
>> index e022d2d..5186c7e 100644
>> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
>> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
>> @@ -101,6 +101,9 @@ Optional endpoint properties
>>     array contains only one entry.
>>   - clock-noncontinuous: a boolean property to allow MIPI CSI-2
>> non-continuous
>>     clock mode.
>> +- sync-on-green-active: polarity field when video synchronization is
>> +  Sync-On-Green. When set the driver determines whether it's a normal
>> operation
>> +  or inverted operation.
>
>
> Would you mind adding this entry after pclk-sample property description ?

OK.

> And how about describing it a bit more precisely and similarly to
> VSYNC/HSYNC,
> e.g.
>
> - sync-on-green-active: active state of Sync-on-green (SoG) signal,
>   0/1 for LOW/HIGH respectively.
>
OK I'll paste the above one itself :-)

--
Regards,
Prabhakar Lad

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

end of thread, other threads:[~2013-07-17  8:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-16 17:19 [PATCH RFC v4] media: OF: add "sync-on-green-active" property Prabhakar Lad
2013-07-16 20:38 ` Sylwester Nawrocki
2013-07-17  8:35   ` Prabhakar Lad

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