aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx2341x.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-06-22 11:03:28 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:11:55 -0400
commite0e31cdb91cddc4cfbf6d5ffa8212f694723269b (patch)
tree50f2c336f17c5fe9f24dff0e6eb172223892ecc6 /drivers/media/video/cx2341x.c
parent37f89f9542c3945bddf46efc15a1b1e349af3f88 (diff)
V4L/DVB (8105): cx2341x: add TS capability
The cx18 can support transport streams with newer firmwares. Add a TS capability to the generic cx2341x module. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx2341x.c')
-rw-r--r--drivers/media/video/cx2341x.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/media/video/cx2341x.c b/drivers/media/video/cx2341x.c
index c592899a2317..5e40c6bd69b6 100644
--- a/drivers/media/video/cx2341x.c
+++ b/drivers/media/video/cx2341x.c
@@ -80,7 +80,7 @@ EXPORT_SYMBOL(cx2341x_mpeg_ctrls);
80 80
81/* Map the control ID to the correct field in the cx2341x_mpeg_params 81/* Map the control ID to the correct field in the cx2341x_mpeg_params
82 struct. Return -EINVAL if the ID is unknown, else return 0. */ 82 struct. Return -EINVAL if the ID is unknown, else return 0. */
83static int cx2341x_get_ctrl(struct cx2341x_mpeg_params *params, 83static int cx2341x_get_ctrl(const struct cx2341x_mpeg_params *params,
84 struct v4l2_ext_control *ctrl) 84 struct v4l2_ext_control *ctrl)
85{ 85{
86 switch (ctrl->id) { 86 switch (ctrl->id) {
@@ -420,7 +420,7 @@ static int cx2341x_ctrl_query_fill(struct v4l2_queryctrl *qctrl,
420 return 0; 420 return 0;
421} 421}
422 422
423int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params, 423int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params,
424 struct v4l2_queryctrl *qctrl) 424 struct v4l2_queryctrl *qctrl)
425{ 425{
426 int err; 426 int err;
@@ -580,9 +580,9 @@ int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params,
580} 580}
581EXPORT_SYMBOL(cx2341x_ctrl_query); 581EXPORT_SYMBOL(cx2341x_ctrl_query);
582 582
583const char **cx2341x_ctrl_get_menu(u32 id) 583const char **cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id)
584{ 584{
585 static const char *mpeg_stream_type[] = { 585 static const char *mpeg_stream_type_without_ts[] = {
586 "MPEG-2 Program Stream", 586 "MPEG-2 Program Stream",
587 "", 587 "",
588 "MPEG-1 System Stream", 588 "MPEG-1 System Stream",
@@ -592,6 +592,16 @@ const char **cx2341x_ctrl_get_menu(u32 id)
592 NULL 592 NULL
593 }; 593 };
594 594
595 static const char *mpeg_stream_type_with_ts[] = {
596 "MPEG-2 Program Stream",
597 "MPEG-2 Transport Stream",
598 "MPEG-1 System Stream",
599 "MPEG-2 DVD-compatible Stream",
600 "MPEG-1 VCD-compatible Stream",
601 "MPEG-2 SVCD-compatible Stream",
602 NULL
603 };
604
595 static const char *cx2341x_video_spatial_filter_mode_menu[] = { 605 static const char *cx2341x_video_spatial_filter_mode_menu[] = {
596 "Manual", 606 "Manual",
597 "Auto", 607 "Auto",
@@ -630,7 +640,8 @@ const char **cx2341x_ctrl_get_menu(u32 id)
630 640
631 switch (id) { 641 switch (id) {
632 case V4L2_CID_MPEG_STREAM_TYPE: 642 case V4L2_CID_MPEG_STREAM_TYPE:
633 return mpeg_stream_type; 643 return (p->capabilities & CX2341X_CAP_HAS_TS) ?
644 mpeg_stream_type_with_ts : mpeg_stream_type_without_ts;
634 case V4L2_CID_MPEG_AUDIO_L1_BITRATE: 645 case V4L2_CID_MPEG_AUDIO_L1_BITRATE:
635 case V4L2_CID_MPEG_AUDIO_L3_BITRATE: 646 case V4L2_CID_MPEG_AUDIO_L3_BITRATE:
636 return NULL; 647 return NULL;
@@ -690,7 +701,7 @@ int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy,
690 if (err) 701 if (err)
691 break; 702 break;
692 if (qctrl.type == V4L2_CTRL_TYPE_MENU) 703 if (qctrl.type == V4L2_CTRL_TYPE_MENU)
693 menu_items = cx2341x_ctrl_get_menu(qctrl.id); 704 menu_items = cx2341x_ctrl_get_menu(params, qctrl.id);
694 err = v4l2_ctrl_check(ctrl, &qctrl, menu_items); 705 err = v4l2_ctrl_check(ctrl, &qctrl, menu_items);
695 if (err) 706 if (err)
696 break; 707 break;
@@ -933,9 +944,9 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func,
933} 944}
934EXPORT_SYMBOL(cx2341x_update); 945EXPORT_SYMBOL(cx2341x_update);
935 946
936static const char *cx2341x_menu_item(struct cx2341x_mpeg_params *p, u32 id) 947static const char *cx2341x_menu_item(const struct cx2341x_mpeg_params *p, u32 id)
937{ 948{
938 const char **menu = cx2341x_ctrl_get_menu(id); 949 const char **menu = cx2341x_ctrl_get_menu(p, id);
939 struct v4l2_ext_control ctrl; 950 struct v4l2_ext_control ctrl;
940 951
941 if (menu == NULL) 952 if (menu == NULL)
@@ -952,7 +963,7 @@ invalid:
952 return "<invalid>"; 963 return "<invalid>";
953} 964}
954 965
955void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix) 966void cx2341x_log_status(const struct cx2341x_mpeg_params *p, const char *prefix)
956{ 967{
957 int is_mpeg1 = p->video_encoding == V4L2_MPEG_VIDEO_ENCODING_MPEG_1; 968 int is_mpeg1 = p->video_encoding == V4L2_MPEG_VIDEO_ENCODING_MPEG_1;
958 int temporal = p->video_temporal_filter; 969 int temporal = p->video_temporal_filter;