diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h | 1 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 38 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.h | 4 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 7 |
4 files changed, 40 insertions, 10 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h index 305e6aaa844a..17fc57989f6c 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h | |||
@@ -323,6 +323,7 @@ struct pvr2_hdw { | |||
323 | struct pvr2_ctl_info std_info_enum; | 323 | struct pvr2_ctl_info std_info_enum; |
324 | struct pvr2_ctl_info std_info_avail; | 324 | struct pvr2_ctl_info std_info_avail; |
325 | struct pvr2_ctl_info std_info_cur; | 325 | struct pvr2_ctl_info std_info_cur; |
326 | struct pvr2_ctl_info std_info_detect; | ||
326 | struct v4l2_standard *std_defs; | 327 | struct v4l2_standard *std_defs; |
327 | const char **std_enum_names; | 328 | const char **std_enum_names; |
328 | 329 | ||
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 534dbf3d0144..c4bb0d1b5f9f 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -346,7 +346,7 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw, | |||
346 | void *write_data,unsigned int write_len, | 346 | void *write_data,unsigned int write_len, |
347 | void *read_data,unsigned int read_len); | 347 | void *read_data,unsigned int read_len); |
348 | static int pvr2_hdw_check_cropcap(struct pvr2_hdw *hdw); | 348 | static int pvr2_hdw_check_cropcap(struct pvr2_hdw *hdw); |
349 | 349 | static v4l2_std_id pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw); | |
350 | 350 | ||
351 | static void trace_stbit(const char *name,int val) | 351 | static void trace_stbit(const char *name,int val) |
352 | { | 352 | { |
@@ -840,6 +840,12 @@ static int ctrl_hsm_get(struct pvr2_ctrl *cptr,int *vp) | |||
840 | return 0; | 840 | return 0; |
841 | } | 841 | } |
842 | 842 | ||
843 | static int ctrl_stddetect_get(struct pvr2_ctrl *cptr, int *vp) | ||
844 | { | ||
845 | *vp = pvr2_hdw_get_detected_std(cptr->hdw); | ||
846 | return 0; | ||
847 | } | ||
848 | |||
843 | static int ctrl_stdavail_get(struct pvr2_ctrl *cptr,int *vp) | 849 | static int ctrl_stdavail_get(struct pvr2_ctrl *cptr,int *vp) |
844 | { | 850 | { |
845 | *vp = cptr->hdw->std_mask_avail; | 851 | *vp = cptr->hdw->std_mask_avail; |
@@ -1302,6 +1308,15 @@ static const struct pvr2_ctl_info control_defs[] = { | |||
1302 | .is_dirty = ctrl_stdenumcur_is_dirty, | 1308 | .is_dirty = ctrl_stdenumcur_is_dirty, |
1303 | .clear_dirty = ctrl_stdenumcur_clear_dirty, | 1309 | .clear_dirty = ctrl_stdenumcur_clear_dirty, |
1304 | .type = pvr2_ctl_enum, | 1310 | .type = pvr2_ctl_enum, |
1311 | },{ | ||
1312 | .desc = "Video Standards Detected Mask", | ||
1313 | .name = "video_standard_mask_detected", | ||
1314 | .internal_id = PVR2_CID_STDDETECT, | ||
1315 | .skip_init = !0, | ||
1316 | .get_value = ctrl_stddetect_get, | ||
1317 | .val_to_sym = ctrl_std_val_to_sym, | ||
1318 | .sym_to_val = ctrl_std_sym_to_val, | ||
1319 | .type = pvr2_ctl_bitmask, | ||
1305 | } | 1320 | } |
1306 | }; | 1321 | }; |
1307 | 1322 | ||
@@ -2629,7 +2644,17 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, | |||
2629 | cptr->info = &hdw->std_info_cur; | 2644 | cptr->info = &hdw->std_info_cur; |
2630 | hdw->std_info_cur.def.type_bitmask.bit_names = | 2645 | hdw->std_info_cur.def.type_bitmask.bit_names = |
2631 | hdw->std_mask_ptrs; | 2646 | hdw->std_mask_ptrs; |
2632 | hdw->std_info_avail.def.type_bitmask.valid_bits = | 2647 | hdw->std_info_cur.def.type_bitmask.valid_bits = |
2648 | valid_std_mask; | ||
2649 | } | ||
2650 | cptr = pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_STDDETECT); | ||
2651 | if (cptr) { | ||
2652 | memcpy(&hdw->std_info_detect,cptr->info, | ||
2653 | sizeof(hdw->std_info_detect)); | ||
2654 | cptr->info = &hdw->std_info_detect; | ||
2655 | hdw->std_info_detect.def.type_bitmask.bit_names = | ||
2656 | hdw->std_mask_ptrs; | ||
2657 | hdw->std_info_detect.def.type_bitmask.valid_bits = | ||
2633 | valid_std_mask; | 2658 | valid_std_mask; |
2634 | } | 2659 | } |
2635 | 2660 | ||
@@ -2995,12 +3020,13 @@ static void pvr2_subdev_set_control(struct pvr2_hdw *hdw, int id, | |||
2995 | pvr2_subdev_set_control(hdw, id, #lab, (hdw)->lab##_val); \ | 3020 | pvr2_subdev_set_control(hdw, id, #lab, (hdw)->lab##_val); \ |
2996 | } | 3021 | } |
2997 | 3022 | ||
2998 | int pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw, v4l2_std_id *std) | 3023 | v4l2_std_id pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw) |
2999 | { | 3024 | { |
3000 | *std = V4L2_STD_ALL; | 3025 | v4l2_std_id std; |
3026 | std = V4L2_STD_ALL; | ||
3001 | v4l2_device_call_all(&hdw->v4l2_dev, 0, | 3027 | v4l2_device_call_all(&hdw->v4l2_dev, 0, |
3002 | video, querystd, std); | 3028 | video, querystd, &std); |
3003 | return 0; | 3029 | return std; |
3004 | } | 3030 | } |
3005 | 3031 | ||
3006 | /* Execute whatever commands are required to update the state of all the | 3032 | /* Execute whatever commands are required to update the state of all the |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/drivers/media/video/pvrusb2/pvrusb2-hdw.h index 66546580b17d..45ddb81475b7 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.h | |||
@@ -46,6 +46,7 @@ | |||
46 | #define PVR2_CID_CROPCAPBT 16 | 46 | #define PVR2_CID_CROPCAPBT 16 |
47 | #define PVR2_CID_CROPCAPBW 17 | 47 | #define PVR2_CID_CROPCAPBW 17 |
48 | #define PVR2_CID_CROPCAPBH 18 | 48 | #define PVR2_CID_CROPCAPBH 18 |
49 | #define PVR2_CID_STDDETECT 19 | ||
49 | 50 | ||
50 | /* Legal values for the INPUT state variable */ | 51 | /* Legal values for the INPUT state variable */ |
51 | #define PVR2_CVAL_INPUT_TV 0 | 52 | #define PVR2_CVAL_INPUT_TV 0 |
@@ -214,9 +215,6 @@ struct pvr2_stream *pvr2_hdw_get_video_stream(struct pvr2_hdw *); | |||
214 | int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std, | 215 | int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std, |
215 | unsigned int idx); | 216 | unsigned int idx); |
216 | 217 | ||
217 | /* Get the detected video standard */ | ||
218 | int pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw, v4l2_std_id *std); | ||
219 | |||
220 | /* Enable / disable retrieval of CPU firmware or prom contents. This must | 218 | /* Enable / disable retrieval of CPU firmware or prom contents. This must |
221 | be enabled before pvr2_hdw_cpufw_get() will function. Note that doing | 219 | be enabled before pvr2_hdw_cpufw_get() will function. Note that doing |
222 | this may prevent the device from running (and leaving this mode may | 220 | this may prevent the device from running (and leaving this mode may |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 3669090f330e..ed497bbf539b 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | |||
@@ -209,8 +209,13 @@ static int pvr2_querystd(struct file *file, void *priv, v4l2_std_id *std) | |||
209 | { | 209 | { |
210 | struct pvr2_v4l2_fh *fh = file->private_data; | 210 | struct pvr2_v4l2_fh *fh = file->private_data; |
211 | struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; | 211 | struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; |
212 | int val = 0; | ||
213 | int ret; | ||
212 | 214 | ||
213 | return pvr2_hdw_get_detected_std(hdw, std); | 215 | ret = pvr2_ctrl_get_value( |
216 | pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_STDDETECT), &val); | ||
217 | *std = val; | ||
218 | return ret; | ||
214 | } | 219 | } |
215 | 220 | ||
216 | static int pvr2_enum_input(struct file *file, void *priv, struct v4l2_input *vi) | 221 | static int pvr2_enum_input(struct file *file, void *priv, struct v4l2_input *vi) |