22 #include <linux/kernel.h>
23 #include <linux/module.h>
29 static unsigned int vbibufs = 4;
33 static unsigned int vbi_debug;
37 #define dprintk(level, fmt, arg...)\
38 do { if (vbi_debug >= level)\
39 printk(KERN_DEBUG "%s/0: " fmt, dev->name, ## arg);\
44 #define VBI_LINE_LENGTH 1440
45 #define NTSC_VBI_START_LINE 10
46 #define NTSC_VBI_END_LINE 21
47 #define NTSC_VBI_LINES (NTSC_VBI_END_LINE - NTSC_VBI_START_LINE + 1)
59 f->
fmt.
vbi.sampling_rate = 27000000;
65 f->
fmt.
vbi.start[1] = 263 + 10 + 1;
69 f->
fmt.
vbi.sampling_rate = 35468950;
70 f->
fmt.
vbi.start[0] = 7 - 1;
71 f->
fmt.
vbi.start[1] = 319 - 1;
89 dprintk(1,
"%s() VID_BC_MSK_VBI_RISCI1\n", __func__);
90 spin_lock(&dev->
slock);
93 spin_unlock(&dev->
slock);
98 dprintk(1,
"%s() VID_BC_MSK_VBI_RISCI2\n", __func__);
100 spin_lock(&dev->
slock);
102 spin_unlock(&dev->
slock);
113 dprintk(1,
"%s()\n", __func__);
117 buf->
vb.width, buf->
risc.dma);
143 if (list_empty(&q->
active))
147 dprintk(2,
"restart_queue [%p/%d]: restart dma\n",
149 cx23885_start_vbi_dma(dev, q, buf);
169 while (!list_empty(&q->
active)) {
175 printk(
"%s/0: [%p/%d] timeout - dma=0x%08lx\n", dev->
name,
176 buf, buf->
vb.i, (
unsigned long)buf->
risc.dma);
179 spin_unlock_irqrestore(&dev->
slock, flags);
183 #define VBI_LINE_LENGTH 1440
184 #define VBI_LINE_COUNT 17
212 if (0 != buf->
vb.baddr && buf->
vb.bsize < size)
226 0, buf->
vb.width * buf->
vb.height,
253 if (list_empty(&q->
active)) {
255 cx23885_start_vbi_dma(dev, q, buf);
259 dprintk(2,
"[%p/%d] vbi_queue - first active\n",
270 dprintk(2,
"[%p/%d] buffer_queue - append to active\n",
284 .buf_setup = vbi_setup,
285 .buf_prepare = vbi_prepare,
286 .buf_queue = vbi_queue,
287 .buf_release = vbi_release,