diff options
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-vbi.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-vbi.c | 64 |
1 files changed, 62 insertions, 2 deletions
diff --git a/drivers/media/video/ivtv/ivtv-vbi.c b/drivers/media/video/ivtv/ivtv-vbi.c index a58c833c2b04..5d8a40f3d2b6 100644 --- a/drivers/media/video/ivtv/ivtv-vbi.c +++ b/drivers/media/video/ivtv/ivtv-vbi.c | |||
@@ -18,10 +18,70 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "ivtv-driver.h" | 20 | #include "ivtv-driver.h" |
21 | #include "ivtv-video.h" | 21 | #include "ivtv-i2c.h" |
22 | #include "ivtv-vbi.h" | ||
23 | #include "ivtv-ioctl.h" | 22 | #include "ivtv-ioctl.h" |
24 | #include "ivtv-queue.h" | 23 | #include "ivtv-queue.h" |
24 | #include "ivtv-vbi.h" | ||
25 | |||
26 | static void ivtv_set_vps(struct ivtv *itv, int enabled, u8 vps1, u8 vps2, u8 vps3, | ||
27 | u8 vps4, u8 vps5) | ||
28 | { | ||
29 | struct v4l2_sliced_vbi_data data; | ||
30 | |||
31 | if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) | ||
32 | return; | ||
33 | data.id = V4L2_SLICED_VPS; | ||
34 | data.field = 0; | ||
35 | data.line = enabled ? 16 : 0; | ||
36 | data.data[4] = vps1; | ||
37 | data.data[10] = vps2; | ||
38 | data.data[11] = vps3; | ||
39 | data.data[12] = vps4; | ||
40 | data.data[13] = vps5; | ||
41 | ivtv_saa7127(itv, VIDIOC_INT_S_VBI_DATA, &data); | ||
42 | } | ||
43 | |||
44 | static void ivtv_set_cc(struct ivtv *itv, int mode, u8 cc1, u8 cc2, u8 cc3, u8 cc4) | ||
45 | { | ||
46 | struct v4l2_sliced_vbi_data data; | ||
47 | |||
48 | if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) | ||
49 | return; | ||
50 | data.id = V4L2_SLICED_CAPTION_525; | ||
51 | data.field = 0; | ||
52 | data.line = (mode & 1) ? 21 : 0; | ||
53 | data.data[0] = cc1; | ||
54 | data.data[1] = cc2; | ||
55 | ivtv_saa7127(itv, VIDIOC_INT_S_VBI_DATA, &data); | ||
56 | data.field = 1; | ||
57 | data.line = (mode & 2) ? 21 : 0; | ||
58 | data.data[0] = cc3; | ||
59 | data.data[1] = cc4; | ||
60 | ivtv_saa7127(itv, VIDIOC_INT_S_VBI_DATA, &data); | ||
61 | } | ||
62 | |||
63 | static void ivtv_set_wss(struct ivtv *itv, int enabled, int mode) | ||
64 | { | ||
65 | struct v4l2_sliced_vbi_data data; | ||
66 | |||
67 | if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) | ||
68 | return; | ||
69 | /* When using a 50 Hz system, always turn on the | ||
70 | wide screen signal with 4x3 ratio as the default. | ||
71 | Turning this signal on and off can confuse certain | ||
72 | TVs. As far as I can tell there is no reason not to | ||
73 | transmit this signal. */ | ||
74 | if ((itv->std & V4L2_STD_625_50) && !enabled) { | ||
75 | enabled = 1; | ||
76 | mode = 0x08; /* 4x3 full format */ | ||
77 | } | ||
78 | data.id = V4L2_SLICED_WSS_625; | ||
79 | data.field = 0; | ||
80 | data.line = enabled ? 23 : 0; | ||
81 | data.data[0] = mode & 0xff; | ||
82 | data.data[1] = (mode >> 8) & 0xff; | ||
83 | ivtv_saa7127(itv, VIDIOC_INT_S_VBI_DATA, &data); | ||
84 | } | ||
25 | 85 | ||
26 | static int odd_parity(u8 c) | 86 | static int odd_parity(u8 c) |
27 | { | 87 | { |