X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmedia%2Fcommon%2Fsaa7146_vbi.c;h=55884d93515630222ca273118d4f92dea92ee006;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=6c4f0bedda1cb0d138b35cc02073a44d5ba50dc6;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/media/common/saa7146_vbi.c b/drivers/media/common/saa7146_vbi.c index 6c4f0bedd..55884d935 100644 --- a/drivers/media/common/saa7146_vbi.c +++ b/drivers/media/common/saa7146_vbi.c @@ -91,7 +91,7 @@ static int vbi_workaround(struct saa7146_dev *dev) saa7146_write(dev, MC2, MASK_04|MASK_20); /* enable rps1 irqs */ - IER_ENABLE(dev,MASK_28); + SAA7146_IER_ENABLE(dev,MASK_28); /* prepare to wait to be woken up by the irq-handler */ add_wait_queue(&vv->vbi_wq, &wait); @@ -109,7 +109,7 @@ static int vbi_workaround(struct saa7146_dev *dev) current->state = TASK_RUNNING; /* disable rps1 irqs */ - IER_DISABLE(dev,MASK_28); + SAA7146_IER_DISABLE(dev,MASK_28); /* stop video-dma3 */ saa7146_write(dev, MC1, MASK_20); @@ -130,7 +130,7 @@ static int vbi_workaround(struct saa7146_dev *dev) return 0; } -void saa7146_set_vbi_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next) +static void saa7146_set_vbi_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next) { struct saa7146_vv *vv = dev->vv_data; @@ -190,7 +190,7 @@ void saa7146_set_vbi_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, s WRITE_RPS1(CMD_STOP); /* enable rps1 irqs */ - IER_ENABLE(dev, MASK_28); + SAA7146_IER_ENABLE(dev, MASK_28); /* write the address of the rps-program */ saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); @@ -213,8 +213,9 @@ static int buffer_activate(struct saa7146_dev *dev, return 0; } -static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l2_field field) +static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,enum v4l2_field field) { + struct file *file = q->priv_data; struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; struct saa7146_buf *buf = (struct saa7146_buf *)vb; @@ -264,7 +265,7 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l return err; } -static int buffer_setup(struct file *file, unsigned int *count, unsigned int *size) +static int buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size) { int llength,lines; @@ -279,8 +280,9 @@ static int buffer_setup(struct file *file, unsigned int *count, unsigned int *si return 0; } -static void buffer_queue(struct file *file, struct videobuf_buffer *vb) +static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) { + struct file *file = q->priv_data; struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; struct saa7146_vv *vv = dev->vv_data; @@ -290,8 +292,9 @@ static void buffer_queue(struct file *file, struct videobuf_buffer *vb) saa7146_buffer_queue(dev,&vv->vbi_q,buf); } -static void buffer_release(struct file *file, struct videobuf_buffer *vb) +static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) { + struct file *file = q->priv_data; struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; struct saa7146_buf *buf = (struct saa7146_buf *)vb; @@ -322,7 +325,7 @@ static void vbi_stop(struct saa7146_fh *fh, struct file *file) saa7146_write(dev, MC1, MASK_29); /* disable rps1 irqs */ - IER_DISABLE(dev, MASK_28); + SAA7146_IER_DISABLE(dev, MASK_28); /* shut down dma 3 transfers */ saa7146_write(dev, MC1, MASK_20); @@ -331,7 +334,7 @@ static void vbi_stop(struct saa7146_fh *fh, struct file *file) saa7146_buffer_finish(dev,&vv->vbi_q,STATE_DONE); } - videobuf_queue_cancel(file,&fh->vbi_q); + videobuf_queue_cancel(&fh->vbi_q); vv->vbi_streaming = NULL; @@ -404,7 +407,8 @@ static int vbi_open(struct saa7146_dev *dev, struct file *file) dev->pci, &dev->slock, V4L2_BUF_TYPE_VBI_CAPTURE, V4L2_FIELD_SEQ_TB, // FIXME: does this really work? - sizeof(struct saa7146_buf)); + sizeof(struct saa7146_buf), + file); init_MUTEX(&fh->vbi_q.lock); init_timer(&fh->vbi_read_timeout); @@ -480,7 +484,8 @@ static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff } mod_timer(&fh->vbi_read_timeout, jiffies+BUFFER_TIMEOUT); - ret = videobuf_read_stream(file, &fh->vbi_q, data, count, ppos, 1); + ret = videobuf_read_stream(&fh->vbi_q, data, count, ppos, 1, + file->f_flags & O_NONBLOCK); /* printk("BASE_ODD3: 0x%08x\n", saa7146_read(dev, BASE_ODD3)); printk("BASE_EVEN3: 0x%08x\n", saa7146_read(dev, BASE_EVEN3));