Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306238
b: refs/heads/master
c: ac04d00
h: refs/heads/master
v: v3
  • Loading branch information
Mike Isely authored and Mauro Carvalho Chehab committed May 7, 2012
1 parent b3fce3f commit c8dc510
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0927ee67dd59f715f2a6c796a86a0eda9ea2e7b2
refs/heads/master: ac04d00ed1ee173c74bd5d55e80aed1f6e77a700
1 change: 1 addition & 0 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ struct pvr2_hdw {
struct pvr2_ctl_info std_info_enum;
struct pvr2_ctl_info std_info_avail;
struct pvr2_ctl_info std_info_cur;
struct pvr2_ctl_info std_info_detect;
struct v4l2_standard *std_defs;
const char **std_enum_names;

Expand Down
38 changes: 32 additions & 6 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
void *write_data,unsigned int write_len,
void *read_data,unsigned int read_len);
static int pvr2_hdw_check_cropcap(struct pvr2_hdw *hdw);

static v4l2_std_id pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw);

static void trace_stbit(const char *name,int val)
{
Expand Down Expand Up @@ -840,6 +840,12 @@ static int ctrl_hsm_get(struct pvr2_ctrl *cptr,int *vp)
return 0;
}

static int ctrl_stddetect_get(struct pvr2_ctrl *cptr, int *vp)
{
*vp = pvr2_hdw_get_detected_std(cptr->hdw);
return 0;
}

static int ctrl_stdavail_get(struct pvr2_ctrl *cptr,int *vp)
{
*vp = cptr->hdw->std_mask_avail;
Expand Down Expand Up @@ -1302,6 +1308,15 @@ static const struct pvr2_ctl_info control_defs[] = {
.is_dirty = ctrl_stdenumcur_is_dirty,
.clear_dirty = ctrl_stdenumcur_clear_dirty,
.type = pvr2_ctl_enum,
},{
.desc = "Video Standards Detected Mask",
.name = "video_standard_mask_detected",
.internal_id = PVR2_CID_STDDETECT,
.skip_init = !0,
.get_value = ctrl_stddetect_get,
.val_to_sym = ctrl_std_val_to_sym,
.sym_to_val = ctrl_std_sym_to_val,
.type = pvr2_ctl_bitmask,
}
};

Expand Down Expand Up @@ -2629,7 +2644,17 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
cptr->info = &hdw->std_info_cur;
hdw->std_info_cur.def.type_bitmask.bit_names =
hdw->std_mask_ptrs;
hdw->std_info_avail.def.type_bitmask.valid_bits =
hdw->std_info_cur.def.type_bitmask.valid_bits =
valid_std_mask;
}
cptr = pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_STDDETECT);
if (cptr) {
memcpy(&hdw->std_info_detect,cptr->info,
sizeof(hdw->std_info_detect));
cptr->info = &hdw->std_info_detect;
hdw->std_info_detect.def.type_bitmask.bit_names =
hdw->std_mask_ptrs;
hdw->std_info_detect.def.type_bitmask.valid_bits =
valid_std_mask;
}

Expand Down Expand Up @@ -2995,12 +3020,13 @@ static void pvr2_subdev_set_control(struct pvr2_hdw *hdw, int id,
pvr2_subdev_set_control(hdw, id, #lab, (hdw)->lab##_val); \
}

int pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw, v4l2_std_id *std)
v4l2_std_id pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw)
{
*std = V4L2_STD_ALL;
v4l2_std_id std;
std = V4L2_STD_ALL;
v4l2_device_call_all(&hdw->v4l2_dev, 0,
video, querystd, std);
return 0;
video, querystd, &std);
return std;
}

/* Execute whatever commands are required to update the state of all the
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#define PVR2_CID_CROPCAPBT 16
#define PVR2_CID_CROPCAPBW 17
#define PVR2_CID_CROPCAPBH 18
#define PVR2_CID_STDDETECT 19

/* Legal values for the INPUT state variable */
#define PVR2_CVAL_INPUT_TV 0
Expand Down Expand Up @@ -214,9 +215,6 @@ struct pvr2_stream *pvr2_hdw_get_video_stream(struct pvr2_hdw *);
int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std,
unsigned int idx);

/* Get the detected video standard */
int pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw, v4l2_std_id *std);

/* Enable / disable retrieval of CPU firmware or prom contents. This must
be enabled before pvr2_hdw_cpufw_get() will function. Note that doing
this may prevent the device from running (and leaving this mode may
Expand Down
7 changes: 6 additions & 1 deletion trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,13 @@ static int pvr2_querystd(struct file *file, void *priv, v4l2_std_id *std)
{
struct pvr2_v4l2_fh *fh = file->private_data;
struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
int val = 0;
int ret;

return pvr2_hdw_get_detected_std(hdw, std);
ret = pvr2_ctrl_get_value(
pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_STDDETECT), &val);
*std = val;
return ret;
}

static int pvr2_enum_input(struct file *file, void *priv, struct v4l2_input *vi)
Expand Down

0 comments on commit c8dc510

Please sign in to comment.