aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/cx2341x.c17
-rw-r--r--drivers/media/video/v4l2-common.c14
-rw-r--r--include/linux/videodev2.h5
-rw-r--r--include/media/cx2341x.h6
4 files changed, 42 insertions, 0 deletions
diff --git a/drivers/media/video/cx2341x.c b/drivers/media/video/cx2341x.c
index 554813e6f65d..01b22eab5725 100644
--- a/drivers/media/video/cx2341x.c
+++ b/drivers/media/video/cx2341x.c
@@ -43,6 +43,7 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)");
43const u32 cx2341x_mpeg_ctrls[] = { 43const u32 cx2341x_mpeg_ctrls[] = {
44 V4L2_CID_MPEG_CLASS, 44 V4L2_CID_MPEG_CLASS,
45 V4L2_CID_MPEG_STREAM_TYPE, 45 V4L2_CID_MPEG_STREAM_TYPE,
46 V4L2_CID_MPEG_STREAM_VBI_FMT,
46 V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ, 47 V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ,
47 V4L2_CID_MPEG_AUDIO_ENCODING, 48 V4L2_CID_MPEG_AUDIO_ENCODING,
48 V4L2_CID_MPEG_AUDIO_L2_BITRATE, 49 V4L2_CID_MPEG_AUDIO_L2_BITRATE,
@@ -135,6 +136,9 @@ static int cx2341x_get_ctrl(struct cx2341x_mpeg_params *params,
135 case V4L2_CID_MPEG_STREAM_TYPE: 136 case V4L2_CID_MPEG_STREAM_TYPE:
136 ctrl->value = params->stream_type; 137 ctrl->value = params->stream_type;
137 break; 138 break;
139 case V4L2_CID_MPEG_STREAM_VBI_FMT:
140 ctrl->value = params->stream_vbi_fmt;
141 break;
138 case V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE: 142 case V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE:
139 ctrl->value = params->video_spatial_filter_mode; 143 ctrl->value = params->video_spatial_filter_mode;
140 break; 144 break;
@@ -257,6 +261,9 @@ static int cx2341x_set_ctrl(struct cx2341x_mpeg_params *params,
257 params->video_bitrate_mode = V4L2_MPEG_VIDEO_BITRATE_MODE_CBR; 261 params->video_bitrate_mode = V4L2_MPEG_VIDEO_BITRATE_MODE_CBR;
258 } 262 }
259 break; 263 break;
264 case V4L2_CID_MPEG_STREAM_VBI_FMT:
265 params->stream_vbi_fmt = ctrl->value;
266 break;
260 case V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE: 267 case V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE:
261 params->video_spatial_filter_mode = ctrl->value; 268 params->video_spatial_filter_mode = ctrl->value;
262 break; 269 break;
@@ -418,6 +425,14 @@ int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params, struct v4l2_queryctrl
418 qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE; 425 qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE;
419 return err; 426 return err;
420 427
428 case V4L2_CID_MPEG_STREAM_VBI_FMT:
429 if (params->capabilities & CX2341X_CAP_HAS_SLICED_VBI)
430 return v4l2_ctrl_query_fill_std(qctrl);
431 return cx2341x_ctrl_query_fill(qctrl,
432 V4L2_MPEG_STREAM_VBI_FMT_NONE,
433 V4L2_MPEG_STREAM_VBI_FMT_NONE, 1,
434 V4L2_MPEG_STREAM_VBI_FMT_NONE);
435
421 /* CX23415/6 specific */ 436 /* CX23415/6 specific */
422 case V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE: 437 case V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE:
423 return cx2341x_ctrl_query_fill(qctrl, 438 return cx2341x_ctrl_query_fill(qctrl,
@@ -639,6 +654,7 @@ void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p)
639{ 654{
640 static struct cx2341x_mpeg_params default_params = { 655 static struct cx2341x_mpeg_params default_params = {
641 /* misc */ 656 /* misc */
657 .capabilities = 0,
642 .port = CX2341X_PORT_MEMORY, 658 .port = CX2341X_PORT_MEMORY,
643 .width = 720, 659 .width = 720,
644 .height = 480, 660 .height = 480,
@@ -646,6 +662,7 @@ void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p)
646 662
647 /* stream */ 663 /* stream */
648 .stream_type = V4L2_MPEG_STREAM_TYPE_MPEG2_PS, 664 .stream_type = V4L2_MPEG_STREAM_TYPE_MPEG2_PS,
665 .stream_vbi_fmt = V4L2_MPEG_STREAM_VBI_FMT_NONE,
649 666
650 /* audio */ 667 /* audio */
651 .audio_sampling_freq = V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000, 668 .audio_sampling_freq = V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000,
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 14e523471354..f4b3d64ebf73 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -1101,6 +1101,11 @@ const char **v4l2_ctrl_get_menu(u32 id)
1101 "MPEG-2 SVCD-compatible Stream", 1101 "MPEG-2 SVCD-compatible Stream",
1102 NULL 1102 NULL
1103 }; 1103 };
1104 static const char *mpeg_stream_vbi_fmt[] = {
1105 "No VBI",
1106 "VBI in private packets, IVTV format",
1107 NULL
1108 };
1104 1109
1105 switch (id) { 1110 switch (id) {
1106 case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ: 1111 case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -1129,6 +1134,8 @@ const char **v4l2_ctrl_get_menu(u32 id)
1129 return mpeg_video_bitrate_mode; 1134 return mpeg_video_bitrate_mode;
1130 case V4L2_CID_MPEG_STREAM_TYPE: 1135 case V4L2_CID_MPEG_STREAM_TYPE:
1131 return mpeg_stream_type; 1136 return mpeg_stream_type;
1137 case V4L2_CID_MPEG_STREAM_VBI_FMT:
1138 return mpeg_stream_vbi_fmt;
1132 default: 1139 default:
1133 return NULL; 1140 return NULL;
1134 } 1141 }
@@ -1182,6 +1189,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
1182 case V4L2_CID_MPEG_STREAM_PID_PCR: name = "Stream PCR Program ID"; break; 1189 case V4L2_CID_MPEG_STREAM_PID_PCR: name = "Stream PCR Program ID"; break;
1183 case V4L2_CID_MPEG_STREAM_PES_ID_AUDIO: name = "Stream PES Audio ID"; break; 1190 case V4L2_CID_MPEG_STREAM_PES_ID_AUDIO: name = "Stream PES Audio ID"; break;
1184 case V4L2_CID_MPEG_STREAM_PES_ID_VIDEO: name = "Stream PES Video ID"; break; 1191 case V4L2_CID_MPEG_STREAM_PES_ID_VIDEO: name = "Stream PES Video ID"; break;
1192 case V4L2_CID_MPEG_STREAM_VBI_FMT: name = "Stream VBI Format"; break;
1185 1193
1186 default: 1194 default:
1187 return -EINVAL; 1195 return -EINVAL;
@@ -1208,6 +1216,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
1208 case V4L2_CID_MPEG_VIDEO_ASPECT: 1216 case V4L2_CID_MPEG_VIDEO_ASPECT:
1209 case V4L2_CID_MPEG_VIDEO_BITRATE_MODE: 1217 case V4L2_CID_MPEG_VIDEO_BITRATE_MODE:
1210 case V4L2_CID_MPEG_STREAM_TYPE: 1218 case V4L2_CID_MPEG_STREAM_TYPE:
1219 case V4L2_CID_MPEG_STREAM_VBI_FMT:
1211 qctrl->type = V4L2_CTRL_TYPE_MENU; 1220 qctrl->type = V4L2_CTRL_TYPE_MENU;
1212 step = 1; 1221 step = 1;
1213 break; 1222 break;
@@ -1367,6 +1376,11 @@ int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl)
1367 return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0); 1376 return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0);
1368 case V4L2_CID_MPEG_STREAM_PES_ID_VIDEO: 1377 case V4L2_CID_MPEG_STREAM_PES_ID_VIDEO:
1369 return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0); 1378 return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0);
1379 case V4L2_CID_MPEG_STREAM_VBI_FMT:
1380 return v4l2_ctrl_query_fill(qctrl,
1381 V4L2_MPEG_STREAM_VBI_FMT_NONE,
1382 V4L2_MPEG_STREAM_VBI_FMT_IVTV, 1,
1383 V4L2_MPEG_STREAM_VBI_FMT_NONE);
1370 default: 1384 default:
1371 return -EINVAL; 1385 return -EINVAL;
1372 } 1386 }
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 8b4745c5e975..a62673dad76e 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -822,6 +822,11 @@ enum v4l2_mpeg_stream_type {
822#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4) 822#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
823#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5) 823#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
824#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6) 824#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
825#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)
826enum v4l2_mpeg_stream_vbi_fmt {
827 V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */
828 V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */
829};
825 830
826/* MPEG audio */ 831/* MPEG audio */
827#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) 832#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h
index 51fb06b4c394..074c4008ad52 100644
--- a/include/media/cx2341x.h
+++ b/include/media/cx2341x.h
@@ -25,8 +25,13 @@ enum cx2341x_port {
25 CX2341X_PORT_SERIAL = 2 25 CX2341X_PORT_SERIAL = 2
26}; 26};
27 27
28enum cx2341x_cap {
29 CX2341X_CAP_HAS_SLICED_VBI = 1 << 0,
30};
31
28struct cx2341x_mpeg_params { 32struct cx2341x_mpeg_params {
29 /* misc */ 33 /* misc */
34 u32 capabilities;
30 enum cx2341x_port port; 35 enum cx2341x_port port;
31 u16 width; 36 u16 width;
32 u16 height; 37 u16 height;
@@ -34,6 +39,7 @@ struct cx2341x_mpeg_params {
34 39
35 /* stream */ 40 /* stream */
36 enum v4l2_mpeg_stream_type stream_type; 41 enum v4l2_mpeg_stream_type stream_type;
42 enum v4l2_mpeg_stream_vbi_fmt stream_vbi_fmt;
37 43
38 /* audio */ 44 /* audio */
39 enum v4l2_mpeg_audio_sampling_freq audio_sampling_freq; 45 enum v4l2_mpeg_audio_sampling_freq audio_sampling_freq;