aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-03-14 08:57:30 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:58:45 -0400
commit32cd527f59f8aa8549067a2c5f989b736f7da79a (patch)
tree2552bd0efffc5bd21011e1f139c1b7a5c9a27390 /drivers/media
parentb26d6e21788864039bfb24840a668f2cb0848930 (diff)
V4L/DVB: v4l: move vbi-specific video ops to a new vbi ops struct
Only a relatively small number of video receivers and transmitters actually support VBI. So start moving the vbi specific ops to an ops struct of their own. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/cx18/cx18-av-core.c6
-rw-r--r--drivers/media/video/cx18/cx18-vbi.c2
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c6
-rw-r--r--drivers/media/video/ivtv/ivtv-vbi.c16
-rw-r--r--drivers/media/video/saa7115.c8
-rw-r--r--drivers/media/video/saa7127.c6
-rw-r--r--drivers/media/video/tvp5150.c4
7 files changed, 34 insertions, 14 deletions
diff --git a/drivers/media/video/cx18/cx18-av-core.c b/drivers/media/video/cx18/cx18-av-core.c
index 3ce45297e56a..4454997c1bf4 100644
--- a/drivers/media/video/cx18/cx18-av-core.c
+++ b/drivers/media/video/cx18/cx18-av-core.c
@@ -1403,17 +1403,21 @@ static const struct v4l2_subdev_audio_ops cx18_av_audio_ops = {
1403 1403
1404static const struct v4l2_subdev_video_ops cx18_av_video_ops = { 1404static const struct v4l2_subdev_video_ops cx18_av_video_ops = {
1405 .s_routing = cx18_av_s_video_routing, 1405 .s_routing = cx18_av_s_video_routing,
1406 .decode_vbi_line = cx18_av_decode_vbi_line,
1407 .s_stream = cx18_av_s_stream, 1406 .s_stream = cx18_av_s_stream,
1408 .g_fmt = cx18_av_g_fmt, 1407 .g_fmt = cx18_av_g_fmt,
1409 .s_fmt = cx18_av_s_fmt, 1408 .s_fmt = cx18_av_s_fmt,
1410}; 1409};
1411 1410
1411static const struct v4l2_subdev_vbi_ops cx18_av_vbi_ops = {
1412 .decode_vbi_line = cx18_av_decode_vbi_line,
1413};
1414
1412static const struct v4l2_subdev_ops cx18_av_ops = { 1415static const struct v4l2_subdev_ops cx18_av_ops = {
1413 .core = &cx18_av_general_ops, 1416 .core = &cx18_av_general_ops,
1414 .tuner = &cx18_av_tuner_ops, 1417 .tuner = &cx18_av_tuner_ops,
1415 .audio = &cx18_av_audio_ops, 1418 .audio = &cx18_av_audio_ops,
1416 .video = &cx18_av_video_ops, 1419 .video = &cx18_av_video_ops,
1420 .vbi = &cx18_av_vbi_ops,
1417}; 1421};
1418 1422
1419int cx18_av_probe(struct cx18 *cx) 1423int cx18_av_probe(struct cx18 *cx)
diff --git a/drivers/media/video/cx18/cx18-vbi.c b/drivers/media/video/cx18/cx18-vbi.c
index 574c1c6974f8..582227522cf0 100644
--- a/drivers/media/video/cx18/cx18-vbi.c
+++ b/drivers/media/video/cx18/cx18-vbi.c
@@ -174,7 +174,7 @@ static u32 compress_sliced_buf(struct cx18 *cx, u8 *buf, u32 size,
174 p[3] != sliced_vbi_eav_rp[1])) 174 p[3] != sliced_vbi_eav_rp[1]))
175 continue; 175 continue;
176 vbi.p = p + 4; 176 vbi.p = p + 4;
177 v4l2_subdev_call(cx->sd_av, video, decode_vbi_line, &vbi); 177 v4l2_subdev_call(cx->sd_av, vbi, decode_vbi_line, &vbi);
178 if (vbi.type) { 178 if (vbi.type) {
179 cx->vbi.sliced_data[line].id = vbi.type; 179 cx->vbi.sliced_data[line].id = vbi.type;
180 cx->vbi.sliced_data[line].field = vbi.is_second_field; 180 cx->vbi.sliced_data[line].field = vbi.is_second_field;
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index f2461cd3de5a..a0f6f82993bc 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -1635,15 +1635,19 @@ static const struct v4l2_subdev_video_ops cx25840_video_ops = {
1635 .s_routing = cx25840_s_video_routing, 1635 .s_routing = cx25840_s_video_routing,
1636 .g_fmt = cx25840_g_fmt, 1636 .g_fmt = cx25840_g_fmt,
1637 .s_fmt = cx25840_s_fmt, 1637 .s_fmt = cx25840_s_fmt,
1638 .decode_vbi_line = cx25840_decode_vbi_line,
1639 .s_stream = cx25840_s_stream, 1638 .s_stream = cx25840_s_stream,
1640}; 1639};
1641 1640
1641static const struct v4l2_subdev_vbi_ops cx25840_vbi_ops = {
1642 .decode_vbi_line = cx25840_decode_vbi_line,
1643};
1644
1642static const struct v4l2_subdev_ops cx25840_ops = { 1645static const struct v4l2_subdev_ops cx25840_ops = {
1643 .core = &cx25840_core_ops, 1646 .core = &cx25840_core_ops,
1644 .tuner = &cx25840_tuner_ops, 1647 .tuner = &cx25840_tuner_ops,
1645 .audio = &cx25840_audio_ops, 1648 .audio = &cx25840_audio_ops,
1646 .video = &cx25840_video_ops, 1649 .video = &cx25840_video_ops,
1650 .vbi = &cx25840_vbi_ops,
1647}; 1651};
1648 1652
1649/* ----------------------------------------------------------------------- */ 1653/* ----------------------------------------------------------------------- */
diff --git a/drivers/media/video/ivtv/ivtv-vbi.c b/drivers/media/video/ivtv/ivtv-vbi.c
index d73af45dede6..e1c347e5ebd8 100644
--- a/drivers/media/video/ivtv/ivtv-vbi.c
+++ b/drivers/media/video/ivtv/ivtv-vbi.c
@@ -38,7 +38,7 @@ static void ivtv_set_vps(struct ivtv *itv, int enabled)
38 data.data[9] = itv->vbi.vps_payload.data[2]; 38 data.data[9] = itv->vbi.vps_payload.data[2];
39 data.data[10] = itv->vbi.vps_payload.data[3]; 39 data.data[10] = itv->vbi.vps_payload.data[3];
40 data.data[11] = itv->vbi.vps_payload.data[4]; 40 data.data[11] = itv->vbi.vps_payload.data[4];
41 ivtv_call_hw(itv, IVTV_HW_SAA7127, video, s_vbi_data, &data); 41 ivtv_call_hw(itv, IVTV_HW_SAA7127, vbi, s_vbi_data, &data);
42} 42}
43 43
44static void ivtv_set_cc(struct ivtv *itv, int mode, const struct vbi_cc *cc) 44static void ivtv_set_cc(struct ivtv *itv, int mode, const struct vbi_cc *cc)
@@ -52,12 +52,12 @@ static void ivtv_set_cc(struct ivtv *itv, int mode, const struct vbi_cc *cc)
52 data.line = (mode & 1) ? 21 : 0; 52 data.line = (mode & 1) ? 21 : 0;
53 data.data[0] = cc->odd[0]; 53 data.data[0] = cc->odd[0];
54 data.data[1] = cc->odd[1]; 54 data.data[1] = cc->odd[1];
55 ivtv_call_hw(itv, IVTV_HW_SAA7127, video, s_vbi_data, &data); 55 ivtv_call_hw(itv, IVTV_HW_SAA7127, vbi, s_vbi_data, &data);
56 data.field = 1; 56 data.field = 1;
57 data.line = (mode & 2) ? 21 : 0; 57 data.line = (mode & 2) ? 21 : 0;
58 data.data[0] = cc->even[0]; 58 data.data[0] = cc->even[0];
59 data.data[1] = cc->even[1]; 59 data.data[1] = cc->even[1];
60 ivtv_call_hw(itv, IVTV_HW_SAA7127, video, s_vbi_data, &data); 60 ivtv_call_hw(itv, IVTV_HW_SAA7127, vbi, s_vbi_data, &data);
61} 61}
62 62
63static void ivtv_set_wss(struct ivtv *itv, int enabled, int mode) 63static void ivtv_set_wss(struct ivtv *itv, int enabled, int mode)
@@ -80,7 +80,7 @@ static void ivtv_set_wss(struct ivtv *itv, int enabled, int mode)
80 data.line = enabled ? 23 : 0; 80 data.line = enabled ? 23 : 0;
81 data.data[0] = mode & 0xff; 81 data.data[0] = mode & 0xff;
82 data.data[1] = (mode >> 8) & 0xff; 82 data.data[1] = (mode >> 8) & 0xff;
83 ivtv_call_hw(itv, IVTV_HW_SAA7127, video, s_vbi_data, &data); 83 ivtv_call_hw(itv, IVTV_HW_SAA7127, vbi, s_vbi_data, &data);
84} 84}
85 85
86static int odd_parity(u8 c) 86static int odd_parity(u8 c)
@@ -316,7 +316,7 @@ static u32 compress_sliced_buf(struct ivtv *itv, u32 line, u8 *buf, u32 size, u8
316 continue; 316 continue;
317 } 317 }
318 vbi.p = p + 4; 318 vbi.p = p + 4;
319 v4l2_subdev_call(itv->sd_video, video, decode_vbi_line, &vbi); 319 v4l2_subdev_call(itv->sd_video, vbi, decode_vbi_line, &vbi);
320 if (vbi.type && !(lines & (1 << vbi.line))) { 320 if (vbi.type && !(lines & (1 << vbi.line))) {
321 lines |= 1 << vbi.line; 321 lines |= 1 << vbi.line;
322 itv->vbi.sliced_data[line].id = vbi.type; 322 itv->vbi.sliced_data[line].id = vbi.type;
@@ -440,7 +440,7 @@ void ivtv_vbi_work_handler(struct ivtv *itv)
440 data.id = V4L2_SLICED_WSS_625; 440 data.id = V4L2_SLICED_WSS_625;
441 data.field = 0; 441 data.field = 0;
442 442
443 if (v4l2_subdev_call(itv->sd_video, video, g_vbi_data, &data) == 0) { 443 if (v4l2_subdev_call(itv->sd_video, vbi, g_vbi_data, &data) == 0) {
444 ivtv_set_wss(itv, 1, data.data[0] & 0xf); 444 ivtv_set_wss(itv, 1, data.data[0] & 0xf);
445 vi->wss_missing_cnt = 0; 445 vi->wss_missing_cnt = 0;
446 } else if (vi->wss_missing_cnt == 4) { 446 } else if (vi->wss_missing_cnt == 4) {
@@ -454,13 +454,13 @@ void ivtv_vbi_work_handler(struct ivtv *itv)
454 454
455 data.id = V4L2_SLICED_CAPTION_525; 455 data.id = V4L2_SLICED_CAPTION_525;
456 data.field = 0; 456 data.field = 0;
457 if (v4l2_subdev_call(itv->sd_video, video, g_vbi_data, &data) == 0) { 457 if (v4l2_subdev_call(itv->sd_video, vbi, g_vbi_data, &data) == 0) {
458 mode |= 1; 458 mode |= 1;
459 cc.odd[0] = data.data[0]; 459 cc.odd[0] = data.data[0];
460 cc.odd[1] = data.data[1]; 460 cc.odd[1] = data.data[1];
461 } 461 }
462 data.field = 1; 462 data.field = 1;
463 if (v4l2_subdev_call(itv->sd_video, video, g_vbi_data, &data) == 0) { 463 if (v4l2_subdev_call(itv->sd_video, vbi, g_vbi_data, &data) == 0) {
464 mode |= 2; 464 mode |= 2;
465 cc.even[0] = data.data[0]; 465 cc.even[0] = data.data[0];
466 cc.even[1] = data.data[1]; 466 cc.even[1] = data.data[1];
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index 72eaa662b66f..cfee323d9c2c 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -1550,18 +1550,22 @@ static const struct v4l2_subdev_video_ops saa711x_video_ops = {
1550 .s_crystal_freq = saa711x_s_crystal_freq, 1550 .s_crystal_freq = saa711x_s_crystal_freq,
1551 .g_fmt = saa711x_g_fmt, 1551 .g_fmt = saa711x_g_fmt,
1552 .s_fmt = saa711x_s_fmt, 1552 .s_fmt = saa711x_s_fmt,
1553 .g_vbi_data = saa711x_g_vbi_data,
1554 .decode_vbi_line = saa711x_decode_vbi_line,
1555 .s_stream = saa711x_s_stream, 1553 .s_stream = saa711x_s_stream,
1556 .querystd = saa711x_querystd, 1554 .querystd = saa711x_querystd,
1557 .g_input_status = saa711x_g_input_status, 1555 .g_input_status = saa711x_g_input_status,
1558}; 1556};
1559 1557
1558static const struct v4l2_subdev_vbi_ops saa711x_vbi_ops = {
1559 .g_vbi_data = saa711x_g_vbi_data,
1560 .decode_vbi_line = saa711x_decode_vbi_line,
1561};
1562
1560static const struct v4l2_subdev_ops saa711x_ops = { 1563static const struct v4l2_subdev_ops saa711x_ops = {
1561 .core = &saa711x_core_ops, 1564 .core = &saa711x_core_ops,
1562 .tuner = &saa711x_tuner_ops, 1565 .tuner = &saa711x_tuner_ops,
1563 .audio = &saa711x_audio_ops, 1566 .audio = &saa711x_audio_ops,
1564 .video = &saa711x_video_ops, 1567 .video = &saa711x_video_ops,
1568 .vbi = &saa711x_vbi_ops,
1565}; 1569};
1566 1570
1567/* ----------------------------------------------------------------------- */ 1571/* ----------------------------------------------------------------------- */
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c
index 250ef84cf5ca..32e11fc9c85c 100644
--- a/drivers/media/video/saa7127.c
+++ b/drivers/media/video/saa7127.c
@@ -727,16 +727,20 @@ static const struct v4l2_subdev_core_ops saa7127_core_ops = {
727}; 727};
728 728
729static const struct v4l2_subdev_video_ops saa7127_video_ops = { 729static const struct v4l2_subdev_video_ops saa7127_video_ops = {
730 .s_vbi_data = saa7127_s_vbi_data,
731 .g_fmt = saa7127_g_fmt, 730 .g_fmt = saa7127_g_fmt,
732 .s_std_output = saa7127_s_std_output, 731 .s_std_output = saa7127_s_std_output,
733 .s_routing = saa7127_s_routing, 732 .s_routing = saa7127_s_routing,
734 .s_stream = saa7127_s_stream, 733 .s_stream = saa7127_s_stream,
735}; 734};
736 735
736static const struct v4l2_subdev_vbi_ops saa7127_vbi_ops = {
737 .s_vbi_data = saa7127_s_vbi_data,
738};
739
737static const struct v4l2_subdev_ops saa7127_ops = { 740static const struct v4l2_subdev_ops saa7127_ops = {
738 .core = &saa7127_core_ops, 741 .core = &saa7127_core_ops,
739 .video = &saa7127_video_ops, 742 .video = &saa7127_video_ops,
743 .vbi = &saa7127_vbi_ops,
740}; 744};
741 745
742/* ----------------------------------------------------------------------- */ 746/* ----------------------------------------------------------------------- */
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c
index 908ffb68e926..caf0a708542e 100644
--- a/drivers/media/video/tvp5150.c
+++ b/drivers/media/video/tvp5150.c
@@ -1046,6 +1046,9 @@ static const struct v4l2_subdev_video_ops tvp5150_video_ops = {
1046 .s_routing = tvp5150_s_routing, 1046 .s_routing = tvp5150_s_routing,
1047 .g_fmt = tvp5150_g_fmt, 1047 .g_fmt = tvp5150_g_fmt,
1048 .s_fmt = tvp5150_s_fmt, 1048 .s_fmt = tvp5150_s_fmt,
1049};
1050
1051static const struct v4l2_subdev_vbi_ops tvp5150_vbi_ops = {
1049 .g_sliced_vbi_cap = tvp5150_g_sliced_vbi_cap, 1052 .g_sliced_vbi_cap = tvp5150_g_sliced_vbi_cap,
1050}; 1053};
1051 1054
@@ -1053,6 +1056,7 @@ static const struct v4l2_subdev_ops tvp5150_ops = {
1053 .core = &tvp5150_core_ops, 1056 .core = &tvp5150_core_ops,
1054 .tuner = &tvp5150_tuner_ops, 1057 .tuner = &tvp5150_tuner_ops,
1055 .video = &tvp5150_video_ops, 1058 .video = &tvp5150_video_ops,
1059 .vbi = &tvp5150_vbi_ops,
1056}; 1060};
1057 1061
1058 1062