camss: Add format field handling in CSIPHY and CSID
authorTodor Tomov <todor.tomov@linaro.org>
Wed, 29 Jun 2016 08:17:42 +0000 (11:17 +0300)
committerNicolas Dechesne <nicolas.dechesne@linaro.org>
Wed, 29 Jun 2016 12:51:06 +0000 (14:51 +0200)
If userspace does not request a specific field (request 'any' field)
set field 'none'.

Signed-off-by: Todor Tomov <todor.tomov@linaro.org>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
drivers/media/platform/msm/camss-8x16/csid.c
drivers/media/platform/msm/camss-8x16/csiphy.c

index 54b6d49..7ca3640 100644 (file)
@@ -380,6 +380,9 @@ static int csid_set_format(struct v4l2_subdev *sd,
                if (format == NULL)
                        return -EINVAL;
 
+               if (fmt->format.field == V4L2_FIELD_ANY)
+                       fmt->format.field = V4L2_FIELD_NONE;
+
                *format = fmt->format;
 
                /* Reset format on source pad */
@@ -419,6 +422,8 @@ static int csid_set_format(struct v4l2_subdev *sd,
 
                        /* Accept only YUV422 format */
                        fmt->format.code = MEDIA_BUS_FMT_UYVY8_2X8;
+                       fmt->format.field = V4L2_FIELD_NONE;
+
                        *format = fmt->format;
                }
        }
index 2b702fb..8f64491 100644 (file)
@@ -352,6 +352,9 @@ static int csiphy_set_format(struct v4l2_subdev *sd,
                if (format == NULL)
                        return -EINVAL;
 
+               if (fmt->format.field == V4L2_FIELD_ANY)
+                       fmt->format.field = V4L2_FIELD_NONE;
+
                *format = fmt->format;
 
                /* Reset format on source pad */