3 static int vbi_pixel_to_capture = 720 * 2;
43 DEB_D(
"...using port b\n");
50 DEB_D(
"...using port a\n");
66 WRITE_RPS1((2 << 16) | (vbi_pixel_to_capture));
85 for(i = 0; i < 2; i++) {
94 SAA7146_IER_ENABLE(dev,
MASK_28);
106 DEB_VBI(
"brs bug workaround %d/1\n", i);
112 SAA7146_IER_DISABLE(dev,
MASK_28);
119 DEB_VBI(
"aborted (rps:0x%08x)\n",
152 vdma3.base_even = buf->
pt[2].offset;
153 vdma3.base_odd = buf->
pt[2].offset + 16 * vbi_pixel_to_capture;
154 vdma3.prot_addr = buf->
pt[2].offset + 16 * 2 * vbi_pixel_to_capture;
155 vdma3.pitch = vbi_pixel_to_capture;
156 vdma3.base_page = buf->
pt[2].dma |
ME1;
157 vdma3.num_line_byte = (16 << 16) | vbi_pixel_to_capture;
195 SAA7146_IER_ENABLE(dev,
MASK_28);
211 DEB_VBI(
"dev:%p, buf:%p, next:%p\n", dev, buf, next);
212 saa7146_set_vbi_capture(dev,buf,next);
226 int lines, llength,
size;
229 llength = vbi_pixel_to_capture;
230 size = lines * llength;
234 if (0 != buf->
vb.baddr && buf->
vb.bsize < size) {
239 if (buf->
vb.size != size)
245 buf->
vb.width = llength;
246 buf->
vb.height = lines;
273 static int buffer_setup(
struct videobuf_queue *q,
unsigned int *count,
unsigned int *size)
278 llength = vbi_pixel_to_capture;
280 *size = lines * llength;
283 DEB_VBI(
"count:%d, size:%d\n", *count, *size);
312 .buf_setup = buffer_setup,
313 .buf_prepare = buffer_prepare,
314 .buf_queue = buffer_queue,
315 .buf_release = buffer_release,
320 static void vbi_stop(
struct saa7146_fh *fh,
struct file *file)
325 DEB_VBI(
"dev:%p, fh:%p\n", dev, fh);
333 SAA7146_IER_DISABLE(dev,
MASK_28);
348 spin_unlock_irqrestore(&dev->
slock, flags);
353 struct file *file = (
struct file*)data;
357 DEB_VBI(
"dev:%p, fh:%p\n", dev, fh);
366 INIT_LIST_HEAD(&vv->
vbi_dmaq.queue);
376 static int vbi_open(
struct saa7146_dev *dev,
struct file *file)
384 DEB_VBI(
"dev:%p, fh:%p\n", dev, fh);
388 DEB_S(
"cannot get vbi RESOURCE_DMA3_BRS resource\n");
393 arbtr_ctrl &= ~0x1f0000;
394 arbtr_ctrl |= 0x1d0000;
414 if (0 != (ret = vbi_workaround(dev))) {
415 DEB_VBI(
"vbi workaround failed!\n");
425 static void vbi_close(
struct saa7146_dev *dev,
struct file *file)
429 DEB_VBI(
"dev:%p, fh:%p\n", dev, fh);
440 spin_lock(&dev->
slock);
453 spin_unlock(&dev->
slock);
456 static ssize_t vbi_read(
struct file *file,
char __user *
data,
size_t count, loff_t *ppos)
463 DEB_VBI(
"dev:%p, fh:%p\n", dev, fh);
472 DEB_VBI(
"open %p is already using vbi capture\n",
495 .release = vbi_close,
496 .irq_done = vbi_irq_done,