diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2018-07-03 07:09:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-10-04 16:21:33 -0400 |
commit | e9be1b863e2c2948deb003df8edd9635b4611a8a (patch) | |
tree | dff19d90b8f295210597183d06b363844aa61ee0 /drivers/media | |
parent | 26c1126c9b56f0d8b6b03d1c03f0cff3fdb3552b (diff) | |
download | blackbird-obmc-linux-e9be1b863e2c2948deb003df8edd9635b4611a8a.tar.gz blackbird-obmc-linux-e9be1b863e2c2948deb003df8edd9635b4611a8a.zip |
media: v4l: fwnode: Use default parallel flags
The caller may provide default flags for the endpoint. Change the
configuration based on what is available through the fwnode property API.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/v4l2-core/v4l2-fwnode.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index 99dc0b6baaae..ae81af5a53dc 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -240,31 +240,44 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus( unsigned int flags = 0; u32 v; + if (bus_type == V4L2_MBUS_PARALLEL || bus_type == V4L2_MBUS_BT656) + flags = bus->flags; + if (!fwnode_property_read_u32(fwnode, "hsync-active", &v)) { + flags &= ~(V4L2_MBUS_HSYNC_ACTIVE_HIGH | + V4L2_MBUS_HSYNC_ACTIVE_LOW); flags |= v ? V4L2_MBUS_HSYNC_ACTIVE_HIGH : V4L2_MBUS_HSYNC_ACTIVE_LOW; pr_debug("hsync-active %s\n", v ? "high" : "low"); } if (!fwnode_property_read_u32(fwnode, "vsync-active", &v)) { + flags &= ~(V4L2_MBUS_VSYNC_ACTIVE_HIGH | + V4L2_MBUS_VSYNC_ACTIVE_LOW); flags |= v ? V4L2_MBUS_VSYNC_ACTIVE_HIGH : V4L2_MBUS_VSYNC_ACTIVE_LOW; pr_debug("vsync-active %s\n", v ? "high" : "low"); } if (!fwnode_property_read_u32(fwnode, "field-even-active", &v)) { + flags &= ~(V4L2_MBUS_FIELD_EVEN_HIGH | + V4L2_MBUS_FIELD_EVEN_LOW); flags |= v ? V4L2_MBUS_FIELD_EVEN_HIGH : V4L2_MBUS_FIELD_EVEN_LOW; pr_debug("field-even-active %s\n", v ? "high" : "low"); } if (!fwnode_property_read_u32(fwnode, "pclk-sample", &v)) { + flags &= ~(V4L2_MBUS_PCLK_SAMPLE_RISING | + V4L2_MBUS_PCLK_SAMPLE_FALLING); flags |= v ? V4L2_MBUS_PCLK_SAMPLE_RISING : V4L2_MBUS_PCLK_SAMPLE_FALLING; pr_debug("pclk-sample %s\n", v ? "high" : "low"); } if (!fwnode_property_read_u32(fwnode, "data-active", &v)) { + flags &= ~(V4L2_MBUS_PCLK_SAMPLE_RISING | + V4L2_MBUS_PCLK_SAMPLE_FALLING); flags |= v ? V4L2_MBUS_DATA_ACTIVE_HIGH : V4L2_MBUS_DATA_ACTIVE_LOW; pr_debug("data-active %s\n", v ? "high" : "low"); @@ -272,8 +285,10 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus( if (fwnode_property_present(fwnode, "slave-mode")) { pr_debug("slave mode\n"); + flags &= ~V4L2_MBUS_MASTER; flags |= V4L2_MBUS_SLAVE; } else { + flags &= ~V4L2_MBUS_SLAVE; flags |= V4L2_MBUS_MASTER; } @@ -288,12 +303,16 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus( } if (!fwnode_property_read_u32(fwnode, "sync-on-green-active", &v)) { + flags &= ~(V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH | + V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW); flags |= v ? V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH : V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW; pr_debug("sync-on-green-active %s\n", v ? "high" : "low"); } if (!fwnode_property_read_u32(fwnode, "data-enable-active", &v)) { + flags &= ~(V4L2_MBUS_DATA_ENABLE_HIGH | + V4L2_MBUS_DATA_ENABLE_LOW); flags |= v ? V4L2_MBUS_DATA_ENABLE_HIGH : V4L2_MBUS_DATA_ENABLE_LOW; pr_debug("data-enable-active %s\n", v ? "high" : "low"); |