aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/pci/cx23885
diff options
context:
space:
mode:
authorHans Verkuil2014-08-09 18:04:41 -0300
committerMauro Carvalho Chehab2014-09-08 10:01:00 -0300
commit96f233e97587a7f6c0f47476118cdb9a23a9ebe0 (patch)
tree1aa03c5e6d43c749db277fe9e5c091cc061af858 /drivers/media/pci/cx23885
parent453afdd9ce33293f640e84dc17e5f366701516e8 (diff)
[media] cx23885: fix field handling
Add missing SEQ_BT/TB support, bottom field is first for all 60 Hz formats, not just NTSC, restore an overwritten field value and initialize dev->field correctly. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/pci/cx23885')
-rw-r--r--drivers/media/pci/cx23885/cx23885-video.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c
index c6921d4bb7dd..defdf7486eda 100644
--- a/drivers/media/pci/cx23885/cx23885-video.c
+++ b/drivers/media/pci/cx23885/cx23885-video.c
@@ -352,7 +352,7 @@ static int buffer_prepare(struct vb2_buffer *vb)
buf->bpl, 0, dev->height);
break;
case V4L2_FIELD_INTERLACED:
- if (dev->tvnorm & V4L2_STD_NTSC)
+ if (dev->tvnorm & V4L2_STD_525_60)
/* NTSC or */
field_tff = 1;
else
@@ -559,6 +559,8 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
maxh = maxh / 2;
break;
case V4L2_FIELD_INTERLACED:
+ case V4L2_FIELD_SEQ_TB:
+ case V4L2_FIELD_SEQ_BT:
break;
default:
field = V4L2_FIELD_INTERLACED;
@@ -598,6 +600,8 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, V4L2_MBUS_FMT_FIXED);
call_all(dev, video, s_mbus_fmt, &mbus_fmt);
v4l2_fill_pix_format(&f->fmt.pix, &mbus_fmt);
+ /* s_mbus_fmt overwrites f->fmt.pix.field, restore it */
+ f->fmt.pix.field = dev->field;
return 0;
}
@@ -1140,6 +1144,7 @@ int cx23885_video_register(struct cx23885_dev *dev)
dev->tvnorm = V4L2_STD_NTSC_M;
dev->fmt = format_by_fourcc(V4L2_PIX_FMT_YUYV);
+ dev->field = V4L2_FIELD_INTERLACED;
dev->width = norm_maxw(dev->tvnorm);
dev->height = norm_maxh(dev->tvnorm);