aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikhil Devshatwar <nikhil.nd@ti.com>2015-05-05 09:49:59 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-06-06 06:27:04 -0400
commit7a60743f347c9d03811c5a2b9aa92431be19e512 (patch)
tree7cdb253aad9b75c1f3cc711b4fcabbe445057909
parent49b7cb5da1867511f10ca9fb7be44c0b2c6a79ee (diff)
[media] v4l: of: Correct pclk-sample for BT656 bus
Current v4l2_of_parse_parallel_bus function attempts to parse the DT properties for the parallel bus as well as BT656 bus. If the pclk-sample property is defined for the BT656 bus, it is still marked as a parallel bus. Fix this by parsing the pclk after the bus_type is selected. Only when hsync or vsync properties are specified, the bus_type should be set to V4L2_MBUS_PARALLEL. Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/v4l2-core/v4l2-of.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/v4l2-core/v4l2-of.c b/drivers/media/v4l2-core/v4l2-of.c
index c52fb9620e11..b27cbb1f5afe 100644
--- a/drivers/media/v4l2-core/v4l2-of.c
+++ b/drivers/media/v4l2-core/v4l2-of.c
@@ -93,10 +93,6 @@ static void v4l2_of_parse_parallel_bus(const struct device_node *node,
93 flags |= v ? V4L2_MBUS_VSYNC_ACTIVE_HIGH : 93 flags |= v ? V4L2_MBUS_VSYNC_ACTIVE_HIGH :
94 V4L2_MBUS_VSYNC_ACTIVE_LOW; 94 V4L2_MBUS_VSYNC_ACTIVE_LOW;
95 95
96 if (!of_property_read_u32(node, "pclk-sample", &v))
97 flags |= v ? V4L2_MBUS_PCLK_SAMPLE_RISING :
98 V4L2_MBUS_PCLK_SAMPLE_FALLING;
99
100 if (!of_property_read_u32(node, "field-even-active", &v)) 96 if (!of_property_read_u32(node, "field-even-active", &v))
101 flags |= v ? V4L2_MBUS_FIELD_EVEN_HIGH : 97 flags |= v ? V4L2_MBUS_FIELD_EVEN_HIGH :
102 V4L2_MBUS_FIELD_EVEN_LOW; 98 V4L2_MBUS_FIELD_EVEN_LOW;
@@ -105,6 +101,10 @@ static void v4l2_of_parse_parallel_bus(const struct device_node *node,
105 else 101 else
106 endpoint->bus_type = V4L2_MBUS_BT656; 102 endpoint->bus_type = V4L2_MBUS_BT656;
107 103
104 if (!of_property_read_u32(node, "pclk-sample", &v))
105 flags |= v ? V4L2_MBUS_PCLK_SAMPLE_RISING :
106 V4L2_MBUS_PCLK_SAMPLE_FALLING;
107
108 if (!of_property_read_u32(node, "data-active", &v)) 108 if (!of_property_read_u32(node, "data-active", &v))
109 flags |= v ? V4L2_MBUS_DATA_ACTIVE_HIGH : 109 flags |= v ? V4L2_MBUS_DATA_ACTIVE_HIGH :
110 V4L2_MBUS_DATA_ACTIVE_LOW; 110 V4L2_MBUS_DATA_ACTIVE_LOW;