aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-17 20:38:38 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:09:41 -0400
commit52284c3e47bf502aaff72ab2ede509193b628b1b (patch)
treefc7d554be7fa0cc2872c585200027eceb17c0d7a /drivers/media/video/em28xx
parentbdfbf9520372daf2b4d6941474c92310848ccb27 (diff)
V4L/DVB (7599): em28xx-dvb: videobuf callbacks are waiting for em28xx_fh
Thanks to Devin Heitmueller <devin.heitmueller@gmail.com> for pointing this issue. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r--drivers/media/video/em28xx/em28xx-dvb.c8
-rw-r--r--drivers/media/video/em28xx/em28xx.h23
2 files changed, 20 insertions, 11 deletions
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index cbc155d302c8..d3d52972cd84 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -45,6 +45,7 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
45 struct em28xx_fh *fh = vq->priv_data; 45 struct em28xx_fh *fh = vq->priv_data;
46 struct em28xx *dev = fh->dev; 46 struct em28xx *dev = fh->dev;
47 47
48 /* FIXME: The better would be to allocate a smaller buffer */
48 *size = 16 * fh->dev->width * fh->dev->height >> 3; 49 *size = 16 * fh->dev->width * fh->dev->height >> 3;
49 if (0 == *count) 50 if (0 == *count)
50 *count = EM28XX_DEF_BUF; 51 *count = EM28XX_DEF_BUF;
@@ -109,11 +110,16 @@ static int dvb_init(struct em28xx *dev)
109 110
110 dev->qops->buf_setup = buffer_setup; 111 dev->qops->buf_setup = buffer_setup;
111 112
113 /* FIXME: Do we need more initialization here? */
114 memset(&dev->dvb_fh, 0, sizeof (dev->dvb_fh));
115 dev->dvb_fh.dev = dev;
116 dev->dvb_fh.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
117
112 videobuf_queue_vmalloc_init(&dev->dvb.dvbq, dev->qops, 118 videobuf_queue_vmalloc_init(&dev->dvb.dvbq, dev->qops,
113 &dev->udev->dev, &dev->slock, 119 &dev->udev->dev, &dev->slock,
114 V4L2_BUF_TYPE_VIDEO_CAPTURE, 120 V4L2_BUF_TYPE_VIDEO_CAPTURE,
115 V4L2_FIELD_ALTERNATE, 121 V4L2_FIELD_ALTERNATE,
116 sizeof(struct em28xx_buffer), dev); 122 sizeof(struct em28xx_buffer), &dev->dvb_fh);
117 123
118 /* init frontend */ 124 /* init frontend */
119 switch (dev->model) { 125 switch (dev->model) {
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index 10f64652c04f..3786dd819bbd 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -304,6 +304,18 @@ struct em28xx_audio {
304 spinlock_t slock; 304 spinlock_t slock;
305}; 305};
306 306
307struct em28xx;
308
309struct em28xx_fh {
310 struct em28xx *dev;
311 unsigned int stream_on:1; /* Locks streams */
312 int radio;
313
314 struct videobuf_queue vb_vidq;
315
316 enum v4l2_buf_type type;
317};
318
307/* main device struct */ 319/* main device struct */
308struct em28xx { 320struct em28xx {
309 /* generic device properties */ 321 /* generic device properties */
@@ -401,19 +413,10 @@ struct em28xx {
401#if defined(CONFIG_VIDEO_EM28XX_DVB) || defined(CONFIG_VIDEO_EM28XX_DVB_MODULE) 413#if defined(CONFIG_VIDEO_EM28XX_DVB) || defined(CONFIG_VIDEO_EM28XX_DVB_MODULE)
402 struct videobuf_dvb dvb; 414 struct videobuf_dvb dvb;
403 struct videobuf_queue_ops *qops; 415 struct videobuf_queue_ops *qops;
416 struct em28xx_fh dvb_fh;
404#endif 417#endif
405}; 418};
406 419
407struct em28xx_fh {
408 struct em28xx *dev;
409 unsigned int stream_on:1; /* Locks streams */
410 int radio;
411
412 struct videobuf_queue vb_vidq;
413
414 enum v4l2_buf_type type;
415};
416
417struct em28xx_ops { 420struct em28xx_ops {
418 struct list_head next; 421 struct list_head next;
419 char *name; 422 char *name;