diff options
-rw-r--r-- | drivers/media/video/cx18/cx18-controls.c | 4 | ||||
-rw-r--r-- | drivers/media/video/cx2341x.c | 29 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-417.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-blackbird.c | 3 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-controls.c | 4 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 3 | ||||
-rw-r--r-- | include/media/cx2341x.h | 7 |
7 files changed, 35 insertions, 17 deletions
diff --git a/drivers/media/video/cx18/cx18-controls.c b/drivers/media/video/cx18/cx18-controls.c index 01ba9ca37d09..855313359370 100644 --- a/drivers/media/video/cx18/cx18-controls.c +++ b/drivers/media/video/cx18/cx18-controls.c | |||
@@ -92,11 +92,13 @@ int cx18_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *qctrl) | |||
92 | 92 | ||
93 | int cx18_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu) | 93 | int cx18_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu) |
94 | { | 94 | { |
95 | struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; | ||
95 | struct v4l2_queryctrl qctrl; | 96 | struct v4l2_queryctrl qctrl; |
96 | 97 | ||
97 | qctrl.id = qmenu->id; | 98 | qctrl.id = qmenu->id; |
98 | cx18_queryctrl(file, fh, &qctrl); | 99 | cx18_queryctrl(file, fh, &qctrl); |
99 | return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id)); | 100 | return v4l2_ctrl_query_menu(qmenu, &qctrl, |
101 | cx2341x_ctrl_get_menu(&cx->params, qmenu->id)); | ||
100 | } | 102 | } |
101 | 103 | ||
102 | int cx18_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl) | 104 | int cx18_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl) |
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. */ |
83 | static int cx2341x_get_ctrl(struct cx2341x_mpeg_params *params, | 83 | static 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 | ||
423 | int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params, | 423 | int 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 | } |
581 | EXPORT_SYMBOL(cx2341x_ctrl_query); | 581 | EXPORT_SYMBOL(cx2341x_ctrl_query); |
582 | 582 | ||
583 | const char **cx2341x_ctrl_get_menu(u32 id) | 583 | const 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 | } |
934 | EXPORT_SYMBOL(cx2341x_update); | 945 | EXPORT_SYMBOL(cx2341x_update); |
935 | 946 | ||
936 | static const char *cx2341x_menu_item(struct cx2341x_mpeg_params *p, u32 id) | 947 | static 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 | ||
955 | void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix) | 966 | void 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; |
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c index acdd3b6b3e7c..0f50c377aa7c 100644 --- a/drivers/media/video/cx23885/cx23885-417.c +++ b/drivers/media/video/cx23885/cx23885-417.c | |||
@@ -1173,7 +1173,7 @@ static int cx23885_querymenu(struct cx23885_dev *dev, | |||
1173 | qctrl.id = qmenu->id; | 1173 | qctrl.id = qmenu->id; |
1174 | cx23885_queryctrl(dev, &qctrl); | 1174 | cx23885_queryctrl(dev, &qctrl); |
1175 | return v4l2_ctrl_query_menu(qmenu, &qctrl, | 1175 | return v4l2_ctrl_query_menu(qmenu, &qctrl, |
1176 | cx2341x_ctrl_get_menu(qmenu->id)); | 1176 | cx2341x_ctrl_get_menu(&dev->mpeg_params, qmenu->id)); |
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | int cx23885_do_ioctl(struct inode *inode, struct file *file, int radio, | 1179 | int cx23885_do_ioctl(struct inode *inode, struct file *file, int radio, |
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index fb67e4188b2f..bfdca5847764 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c | |||
@@ -715,7 +715,8 @@ static int vidioc_querymenu (struct file *file, void *priv, | |||
715 | 715 | ||
716 | qctrl.id = qmenu->id; | 716 | qctrl.id = qmenu->id; |
717 | blackbird_queryctrl(dev, &qctrl); | 717 | blackbird_queryctrl(dev, &qctrl); |
718 | return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id)); | 718 | return v4l2_ctrl_query_menu(qmenu, &qctrl, |
719 | cx2341x_ctrl_get_menu(&dev->params, qmenu->id)); | ||
719 | } | 720 | } |
720 | 721 | ||
721 | static int vidioc_querycap (struct file *file, void *priv, | 722 | static int vidioc_querycap (struct file *file, void *priv, |
diff --git a/drivers/media/video/ivtv/ivtv-controls.c b/drivers/media/video/ivtv/ivtv-controls.c index 2df9b0668f1f..6a5b70912959 100644 --- a/drivers/media/video/ivtv/ivtv-controls.c +++ b/drivers/media/video/ivtv/ivtv-controls.c | |||
@@ -89,11 +89,13 @@ int ivtv_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *qctrl) | |||
89 | 89 | ||
90 | int ivtv_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu) | 90 | int ivtv_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu) |
91 | { | 91 | { |
92 | struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; | ||
92 | struct v4l2_queryctrl qctrl; | 93 | struct v4l2_queryctrl qctrl; |
93 | 94 | ||
94 | qctrl.id = qmenu->id; | 95 | qctrl.id = qmenu->id; |
95 | ivtv_queryctrl(file, fh, &qctrl); | 96 | ivtv_queryctrl(file, fh, &qctrl); |
96 | return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id)); | 97 | return v4l2_ctrl_query_menu(qmenu, &qctrl, |
98 | cx2341x_ctrl_get_menu(&itv->params, qmenu->id)); | ||
97 | } | 99 | } |
98 | 100 | ||
99 | int ivtv_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl) | 101 | int ivtv_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl) |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index f30e13f6ee74..6517ba81bd4b 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -2013,7 +2013,8 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, | |||
2013 | case V4L2_CTRL_TYPE_MENU: | 2013 | case V4L2_CTRL_TYPE_MENU: |
2014 | ciptr->type = pvr2_ctl_enum; | 2014 | ciptr->type = pvr2_ctl_enum; |
2015 | ciptr->def.type_enum.value_names = | 2015 | ciptr->def.type_enum.value_names = |
2016 | cx2341x_ctrl_get_menu(ciptr->v4l_id); | 2016 | cx2341x_ctrl_get_menu(&hdw->enc_ctl_state, |
2017 | ciptr->v4l_id); | ||
2017 | for (cnt1 = 0; | 2018 | for (cnt1 = 0; |
2018 | ciptr->def.type_enum.value_names[cnt1] != NULL; | 2019 | ciptr->def.type_enum.value_names[cnt1] != NULL; |
2019 | cnt1++) { } | 2020 | cnt1++) { } |
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h index 5f4608e88476..9ec4d5889ef5 100644 --- a/include/media/cx2341x.h +++ b/include/media/cx2341x.h | |||
@@ -27,6 +27,7 @@ enum cx2341x_port { | |||
27 | 27 | ||
28 | enum cx2341x_cap { | 28 | enum cx2341x_cap { |
29 | CX2341X_CAP_HAS_SLICED_VBI = 1 << 0, | 29 | CX2341X_CAP_HAS_SLICED_VBI = 1 << 0, |
30 | CX2341X_CAP_HAS_TS = 1 << 1, | ||
30 | }; | 31 | }; |
31 | 32 | ||
32 | struct cx2341x_mpeg_params { | 33 | struct cx2341x_mpeg_params { |
@@ -88,13 +89,13 @@ typedef int (*cx2341x_mbox_func)(void *priv, u32 cmd, int in, int out, | |||
88 | int cx2341x_update(void *priv, cx2341x_mbox_func func, | 89 | int cx2341x_update(void *priv, cx2341x_mbox_func func, |
89 | const struct cx2341x_mpeg_params *old, | 90 | const struct cx2341x_mpeg_params *old, |
90 | const struct cx2341x_mpeg_params *new); | 91 | const struct cx2341x_mpeg_params *new); |
91 | int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params, | 92 | int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params, |
92 | struct v4l2_queryctrl *qctrl); | 93 | struct v4l2_queryctrl *qctrl); |
93 | const char **cx2341x_ctrl_get_menu(u32 id); | 94 | const char **cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id); |
94 | int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy, | 95 | int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy, |
95 | struct v4l2_ext_controls *ctrls, unsigned int cmd); | 96 | struct v4l2_ext_controls *ctrls, unsigned int cmd); |
96 | void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); | 97 | void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); |
97 | void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix); | 98 | void cx2341x_log_status(const struct cx2341x_mpeg_params *p, const char *prefix); |
98 | 99 | ||
99 | /* Firmware names */ | 100 | /* Firmware names */ |
100 | #define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw" | 101 | #define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw" |