diff options
author | Mike Isely <isely@pobox.com> | 2008-08-31 18:55:03 -0500 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2008-08-31 18:55:03 -0500 |
commit | 596acdb938b1e1c2f61c0bddc1359ce91d3f4db2 (patch) | |
tree | d3599525ef49260a01783ab896a4b694998795f5 /linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c | |
parent | a397e1f70d7ece4029a16e5bda4f556467252a8c (diff) | |
download | mediapointer-dvb-s2-596acdb938b1e1c2f61c0bddc1359ce91d3f4db2.tar.gz mediapointer-dvb-s2-596acdb938b1e1c2f61c0bddc1359ce91d3f4db2.tar.bz2 |
pvrusb2: Be able to programmatically retrieve a control's default value
From: Mike Isely <isely@pobox.com>
The pvrusb2 control mechanism up until now has used a constant int to
hold a control's default value. This change makes it possible to
retrieve the control's default through some other means, e.g. as a
result of a query from lower level software.
Priority: normal
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c b/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c index 3b982d963..fb2ed3cb7 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c @@ -135,13 +135,19 @@ int pvr2_ctrl_get_min(struct pvr2_ctrl *cptr) /* Retrieve control's default value (any type) */ -int pvr2_ctrl_get_def(struct pvr2_ctrl *cptr) +int pvr2_ctrl_get_def(struct pvr2_ctrl *cptr, int *valptr) { int ret = 0; if (!cptr) return 0; LOCK_TAKE(cptr->hdw->big_lock); do { if (cptr->info->type == pvr2_ctl_int) { - ret = cptr->info->default_value; + if (cptr->info->get_def_value) { + /* Comment to keep checkpatch.pl quiet */ + ret = cptr->info->get_def_value(cptr, valptr); + } else { + /* Comment to keep checkpatch.pl quiet */ + *valptr = cptr->info->default_value; + } } } while(0); LOCK_GIVE(cptr->hdw->big_lock); return ret; |