]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
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 54b6d49a90f0321dac5b248db95c35b3324509cd..7ca3640fb811b4962939016b520b84b76de66b71 100644 (file)
@@ -380,6 +380,9 @@ static int csid_set_format(struct v4l2_subdev *sd,
                if (format == NULL)
                        return -EINVAL;
 
                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 */
                *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;
 
                        /* Accept only YUV422 format */
                        fmt->format.code = MEDIA_BUS_FMT_UYVY8_2X8;
+                       fmt->format.field = V4L2_FIELD_NONE;
+
                        *format = fmt->format;
                }
        }
                        *format = fmt->format;
                }
        }
index 2b702fbd4eb997f235dcd6519c9e350baab0ea26..8f64491940a9756d46351eba5c3934b701fe75a4 100644 (file)
@@ -352,6 +352,9 @@ static int csiphy_set_format(struct v4l2_subdev *sd,
                if (format == NULL)
                        return -EINVAL;
 
                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 */
                *format = fmt->format;
 
                /* Reset format on source pad */