diff options
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 9 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 2 |
3 files changed, 14 insertions, 0 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 81a35a8e2..a0b0cd8aa 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -1530,6 +1530,15 @@ int pvr2_hdw_get_ctl_max_value(struct pvr2_hdw *hdw,unsigned int ctl_id) } +/* Retrieve default value for a given control */ +int pvr2_hdw_get_ctl_default_value(struct pvr2_hdw *hdw,unsigned int ctl_id) +{ + if (ctl_id >= CTRL_COUNT) return 0; + if (!control_defs[ctl_id].is_valid) return 0; + return control_defs[ctl_id].default_value; +} + + /* Set current value for given control - normally this is just stored and the hardware isn't updated until the commit function is called. */ int pvr2_hdw_set_ctl_value_internal(struct pvr2_hdw *hdw, diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h index 6cc841b56..d7749138c 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h @@ -224,6 +224,9 @@ int pvr2_hdw_get_ctl_min_value(struct pvr2_hdw *,unsigned int ctl_id); /* Retrieve legal maximum value for a given control */ int pvr2_hdw_get_ctl_max_value(struct pvr2_hdw *,unsigned int ctl_id); +/* Retrieve legal maximum value for a given control */ +int pvr2_hdw_get_ctl_default_value(struct pvr2_hdw *,unsigned int ctl_id); + /* Set current value for given control - this is just stored; the hardware isn't updated until the commit function is called. */ int pvr2_hdw_set_ctl_value(struct pvr2_hdw *,unsigned int ctl_id,int value); diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index dd207fae4..4cdd08708 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -788,6 +788,8 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, sizeof(vc->name)); vc->minimum = pvr2_hdw_get_ctl_min_value(hdw,pvr2_id); vc->maximum = pvr2_hdw_get_ctl_max_value(hdw,pvr2_id); + vc->default_value = + pvr2_hdw_get_ctl_default_value(hdw,pvr2_id); vc->step = 1; ret = 0; break; |