V4L/DVB (10090): soc-camera: let drivers decide upon supported field values
[deliverable/linux.git] / drivers / media / video / pxa_camera.c
index c3c50de0aa50357839760f73fbfdc8adbbab684f..b2d9fe5dfd614eb7dbc73896f951feb61c30b168 100644 (file)
@@ -1215,6 +1215,7 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd,
        const struct soc_camera_format_xlate *xlate;
        struct v4l2_pix_format *pix = &f->fmt.pix;
        __u32 pixfmt = pix->pixelformat;
+       enum v4l2_field field;
        int ret;
 
        xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
@@ -1244,6 +1245,15 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd,
        ret = icd->ops->try_fmt(icd, f);
        pix->pixelformat = xlate->host_fmt->fourcc;
 
+       field = pix->field;
+
+       if (field == V4L2_FIELD_ANY) {
+               pix->field = V4L2_FIELD_NONE;
+       } else if (field != V4L2_FIELD_NONE) {
+               dev_err(&icd->dev, "Field type %d unsupported.\n", field);
+               return -EINVAL;
+       }
+
        return ret;
 }
 
This page took 0.025458 seconds and 5 git commands to generate.