summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLad, Prabhakar <prabhakar.csengg@gmail.com>2013-08-11 02:02:24 -0300
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:44:28 +0900
commita4bc30816a960377d6f13660f066dda3b1dde3d5 (patch)
tree54315a7a93c9b97ac509264b14490511dcbee766
parentbf78a2118b0c8023eaa932ebf6c217d715016b5c (diff)
downloadlinux-3.10-a4bc30816a960377d6f13660f066dda3b1dde3d5.tar.gz
linux-3.10-a4bc30816a960377d6f13660f066dda3b1dde3d5.tar.bz2
linux-3.10-a4bc30816a960377d6f13660f066dda3b1dde3d5.zip
[media] media: OF: add "sync-on-green-active" property
This patch adds 'sync-on-green-active' property as part of endpoint property. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--Documentation/devicetree/bindings/media/video-interfaces.txt2
-rw-r--r--drivers/media/v4l2-core/v4l2-of.c4
-rw-r--r--include/media/v4l2-mediabus.h3
3 files changed, 9 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
index e022d2dc496..ce719f89dd1 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.txt
+++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
@@ -88,6 +88,8 @@ Optional endpoint properties
- field-even-active: field signal level during the even field data transmission.
- pclk-sample: sample data on rising (1) or falling (0) edge of the pixel clock
signal.
+- sync-on-green-active: active state of Sync-on-green (SoG) signal, 0/1 for
+ LOW/HIGH respectively.
- data-lanes: an array of physical data lane indexes. Position of an entry
determines the logical lane number, while the value of an entry indicates
physical lane, e.g. for 2-lane MIPI CSI-2 bus we could have
diff --git a/drivers/media/v4l2-core/v4l2-of.c b/drivers/media/v4l2-core/v4l2-of.c
index ed305d8c65f..a6478dca0cd 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 83ae07e5335..395c4a95a42 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -40,6 +40,9 @@
#define V4L2_MBUS_FIELD_EVEN_HIGH (1 << 10)
/* FIELD = 1/0 - Field1 (odd)/Field2 (even) */
#define V4L2_MBUS_FIELD_EVEN_LOW (1 << 11)
+/* Active state of Sync-on-green (SoG) signal, 0/1 for LOW/HIGH respectively. */
+#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 */