diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2008-12-18 12:52:08 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 09:40:26 -0200 |
commit | 06daa1af4d207e93c9a8a3e54adef8635ba81c94 (patch) | |
tree | ca11a35ceab944222d99926c8ce50e470bb89565 /drivers/media/video/pxa_camera.c | |
parent | ccab8a29040b4b57a45f2150c9b6e6115ebdbc44 (diff) | |
download | linux-06daa1af4d207e93c9a8a3e54adef8635ba81c94.tar.gz linux-06daa1af4d207e93c9a8a3e54adef8635ba81c94.tar.bz2 linux-06daa1af4d207e93c9a8a3e54adef8635ba81c94.zip |
V4L/DVB (10090): soc-camera: let drivers decide upon supported field values
sh_mobile_ceu_camera.c is already prepared to support interlaced format, this
patch moves the choice of a field type down to host and / or camera drivers.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pxa_camera.c')
-rw-r--r-- | drivers/media/video/pxa_camera.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index c3c50de0aa50..b2d9fe5dfd61 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c @@ -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; } |