summaryrefslogtreecommitdiff
path: root/drivers/media/usb/em28xx/em28xx-vbi.c
diff options
context:
space:
mode:
authorFrank Schaefer <fschaefer.oss@googlemail.com>2014-03-24 16:33:14 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-05-23 13:14:53 -0300
commit753aee7738ed2ee8c810524ee32b556ac7617f2e (patch)
tree06d6bfb97f0e07606afa4e79529b31d69609349d /drivers/media/usb/em28xx/em28xx-vbi.c
parent27a36df63b5befa3b142d4aef54f3a240c8bd977 (diff)
downloadlinux-753aee7738ed2ee8c810524ee32b556ac7617f2e.tar.gz
linux-753aee7738ed2ee8c810524ee32b556ac7617f2e.tar.xz
[media] em28xx: move v4l2 frame resolutions and scale data from struct em28xx to struct v4l2
The em28xx scaler data are used only for analog video. Move them to struct em28xx_v4l2. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-vbi.c')
-rw-r--r--drivers/media/usb/em28xx/em28xx-vbi.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-vbi.c b/drivers/media/usb/em28xx/em28xx-vbi.c
index db3d655600df..6d7f657f6f55 100644
--- a/drivers/media/usb/em28xx/em28xx-vbi.c
+++ b/drivers/media/usb/em28xx/em28xx-vbi.c
@@ -47,12 +47,13 @@ static int vbi_queue_setup(struct vb2_queue *vq, const struct v4l2_format *fmt,
unsigned int sizes[], void *alloc_ctxs[])
{
struct em28xx *dev = vb2_get_drv_priv(vq);
+ struct em28xx_v4l2 *v4l2 = dev->v4l2;
unsigned long size;
if (fmt)
size = fmt->fmt.pix.sizeimage;
else
- size = dev->vbi_width * dev->vbi_height * 2;
+ size = v4l2->vbi_width * v4l2->vbi_height * 2;
if (0 == *nbuffers)
*nbuffers = 32;
@@ -69,11 +70,12 @@ static int vbi_queue_setup(struct vb2_queue *vq, const struct v4l2_format *fmt,
static int vbi_buffer_prepare(struct vb2_buffer *vb)
{
- struct em28xx *dev = vb2_get_drv_priv(vb->vb2_queue);
- struct em28xx_buffer *buf = container_of(vb, struct em28xx_buffer, vb);
+ struct em28xx *dev = vb2_get_drv_priv(vb->vb2_queue);
+ struct em28xx_v4l2 *v4l2 = dev->v4l2;
+ struct em28xx_buffer *buf = container_of(vb, struct em28xx_buffer, vb);
unsigned long size;
- size = dev->vbi_width * dev->vbi_height * 2;
+ size = v4l2->vbi_width * v4l2->vbi_height * 2;
if (vb2_plane_size(vb, 0) < size) {
printk(KERN_INFO "%s data will not fit into plane (%lu < %lu)\n",