* [PATCH] v4l: of: Correct pclk-sample for BT656 bus
@ 2015-05-05 13:49 Nikhil Devshatwar
2015-05-05 14:11 ` Sylwester Nawrocki
0 siblings, 1 reply; 2+ messages in thread
From: Nikhil Devshatwar @ 2015-05-05 13:49 UTC (permalink / raw)
To: linux-media; +Cc: s.nawrocki, Nikhil Devshatwar
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>
---
drivers/media/v4l2-core/v4l2-of.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-of.c b/drivers/media/v4l2-core/v4l2-of.c
index c52fb96..b27cbb1 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,
flags |= v ? V4L2_MBUS_VSYNC_ACTIVE_HIGH :
V4L2_MBUS_VSYNC_ACTIVE_LOW;
- if (!of_property_read_u32(node, "pclk-sample", &v))
- flags |= v ? V4L2_MBUS_PCLK_SAMPLE_RISING :
- V4L2_MBUS_PCLK_SAMPLE_FALLING;
-
if (!of_property_read_u32(node, "field-even-active", &v))
flags |= v ? V4L2_MBUS_FIELD_EVEN_HIGH :
V4L2_MBUS_FIELD_EVEN_LOW;
@@ -105,6 +101,10 @@ static void v4l2_of_parse_parallel_bus(const struct device_node *node,
else
endpoint->bus_type = V4L2_MBUS_BT656;
+ if (!of_property_read_u32(node, "pclk-sample", &v))
+ flags |= v ? V4L2_MBUS_PCLK_SAMPLE_RISING :
+ V4L2_MBUS_PCLK_SAMPLE_FALLING;
+
if (!of_property_read_u32(node, "data-active", &v))
flags |= v ? V4L2_MBUS_DATA_ACTIVE_HIGH :
V4L2_MBUS_DATA_ACTIVE_LOW;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] v4l: of: Correct pclk-sample for BT656 bus
2015-05-05 13:49 [PATCH] v4l: of: Correct pclk-sample for BT656 bus Nikhil Devshatwar
@ 2015-05-05 14:11 ` Sylwester Nawrocki
0 siblings, 0 replies; 2+ messages in thread
From: Sylwester Nawrocki @ 2015-05-05 14:11 UTC (permalink / raw)
To: Nikhil Devshatwar
Cc: linux-media, Philipp Zabel, vladimir.barinov, Laurent Pinchart,
Guennadi Liakhovetski
On 05/05/15 15:49, Nikhil Devshatwar wrote:
> 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>
Thanks for the patch.
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
I'd say this should be backported to stable.
> ---
> drivers/media/v4l2-core/v4l2-of.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-of.c b/drivers/media/v4l2-core/v4l2-of.c
> index c52fb96..b27cbb1 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,
> flags |= v ? V4L2_MBUS_VSYNC_ACTIVE_HIGH :
> V4L2_MBUS_VSYNC_ACTIVE_LOW;
>
> - if (!of_property_read_u32(node, "pclk-sample", &v))
> - flags |= v ? V4L2_MBUS_PCLK_SAMPLE_RISING :
> - V4L2_MBUS_PCLK_SAMPLE_FALLING;
> -
> if (!of_property_read_u32(node, "field-even-active", &v))
> flags |= v ? V4L2_MBUS_FIELD_EVEN_HIGH :
> V4L2_MBUS_FIELD_EVEN_LOW;
> @@ -105,6 +101,10 @@ static void v4l2_of_parse_parallel_bus(const struct device_node *node,
> else
> endpoint->bus_type = V4L2_MBUS_BT656;
>
> + if (!of_property_read_u32(node, "pclk-sample", &v))
> + flags |= v ? V4L2_MBUS_PCLK_SAMPLE_RISING :
> + V4L2_MBUS_PCLK_SAMPLE_FALLING;
> +
> if (!of_property_read_u32(node, "data-active", &v))
> flags |= v ? V4L2_MBUS_DATA_ACTIVE_HIGH :
> V4L2_MBUS_DATA_ACTIVE_LOW;
--
Regards,
Sylwester
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-05 14:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-05 13:49 [PATCH] v4l: of: Correct pclk-sample for BT656 bus Nikhil Devshatwar
2015-05-05 14:11 ` Sylwester Nawrocki
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).