aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-vbi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-vbi.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-vbi.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/media/video/cx23885/cx23885-vbi.c b/drivers/media/video/cx23885/cx23885-vbi.c
index 23ff09877395..1b3a01c8d1fa 100644
--- a/drivers/media/video/cx23885/cx23885-vbi.c
+++ b/drivers/media/video/cx23885/cx23885-vbi.c
@@ -41,6 +41,12 @@ MODULE_PARM_DESC(vbi_debug, "enable debug messages [vbi]");
41 41
42/* ------------------------------------------------------------------ */ 42/* ------------------------------------------------------------------ */
43 43
44#define VBI_LINE_LENGTH 1440
45#define NTSC_VBI_START_LINE 10 /* line 10 - 21 */
46#define NTSC_VBI_END_LINE 21
47#define NTSC_VBI_LINES (NTSC_VBI_END_LINE - NTSC_VBI_START_LINE + 1)
48
49
44int cx23885_vbi_fmt(struct file *file, void *priv, 50int cx23885_vbi_fmt(struct file *file, void *priv,
45 struct v4l2_format *f) 51 struct v4l2_format *f)
46{ 52{
@@ -49,16 +55,21 @@ int cx23885_vbi_fmt(struct file *file, void *priv,
49 55
50 if (dev->tvnorm & V4L2_STD_525_60) { 56 if (dev->tvnorm & V4L2_STD_525_60) {
51 /* ntsc */ 57 /* ntsc */
58 f->fmt.vbi.samples_per_line = VBI_LINE_LENGTH;
52 f->fmt.vbi.sampling_rate = 28636363; 59 f->fmt.vbi.sampling_rate = 28636363;
60 f->fmt.vbi.sample_format = V4L2_PIX_FMT_GREY;
61 f->fmt.vbi.offset = 64 * 4;
53 f->fmt.vbi.start[0] = 10; 62 f->fmt.vbi.start[0] = 10;
54 f->fmt.vbi.start[1] = 273; 63 f->fmt.vbi.count[0] = 17;
55 64 f->fmt.vbi.start[1] = 272;
65 f->fmt.vbi.count[1] = 17;
56 } else if (dev->tvnorm & V4L2_STD_625_50) { 66 } else if (dev->tvnorm & V4L2_STD_625_50) {
57 /* pal */ 67 /* pal */
58 f->fmt.vbi.sampling_rate = 35468950; 68 f->fmt.vbi.sampling_rate = 35468950;
59 f->fmt.vbi.start[0] = 7 - 1; 69 f->fmt.vbi.start[0] = 7 - 1;
60 f->fmt.vbi.start[1] = 319 - 1; 70 f->fmt.vbi.start[1] = 319 - 1;
61 } 71 }
72
62 return 0; 73 return 0;
63} 74}
64 75
@@ -106,6 +117,8 @@ static int cx23885_start_vbi_dma(struct cx23885_dev *dev,
106 117
107 /* reset counter */ 118 /* reset counter */
108 cx_write(VID_A_GPCNT_CTL, 3); 119 cx_write(VID_A_GPCNT_CTL, 3);
120 cx_write(VID_A_VBI_CTRL, 3);
121 cx_write(VBI_A_GPCNT_CTL, 3);
109 q->count = 1; 122 q->count = 1;
110 123
111 /* enable irq */ 124 /* enable irq */
@@ -168,7 +181,7 @@ void cx23885_vbi_timeout(unsigned long data)
168} 181}
169 182
170/* ------------------------------------------------------------------ */ 183/* ------------------------------------------------------------------ */
171#define VBI_LINE_LENGTH 2048 184#define VBI_LINE_LENGTH 1440
172#define VBI_LINE_COUNT 17 185#define VBI_LINE_COUNT 17
173 186
174static int 187static int