diff options
author | Mike Isely <isely@pobox.com> | 2006-12-27 20:28:54 -0600 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2006-12-27 20:28:54 -0600 |
commit | 77e20d6a82bf9fddc65869883b6a5b4c54e75ec2 (patch) | |
tree | 843824c7845bcb48dc2b00345ef45626754574e7 /linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |
parent | 99f9ef930137ebd1f212ab52256394694fecfcdc (diff) | |
download | mediapointer-dvb-s2-77e20d6a82bf9fddc65869883b6a5b4c54e75ec2.tar.gz mediapointer-dvb-s2-77e20d6a82bf9fddc65869883b6a5b4c54e75ec2.tar.bz2 |
pvrusb2: Newer frequency range checking
From: Mike Isely <isely@pobox.com>
Implement new method for doing integer range checking, so that we can
more intelligently range-check radio and tv ranges at once.
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 75c35186e..908a4fc91 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -382,6 +382,15 @@ static int ctrl_vres_min_get(struct pvr2_ctrl *cptr,int *vp) return 0; } +static int ctrl_freq_check(struct pvr2_ctrl *cptr,int v) +{ + if (cptr->hdw->input_val == PVR2_CVAL_INPUT_RADIO) { + return ((v >= RADIO_MIN_FREQ) && (v <= RADIO_MAX_FREQ)); + } else { + return ((v >= TV_MIN_FREQ) && (v <= TV_MAX_FREQ)); + } +} + static int ctrl_freq_max_get(struct pvr2_ctrl *cptr, int *vp) { /* Actual maximum depends on radio/tv mode */ @@ -789,6 +798,7 @@ static const struct pvr2_ctl_info control_defs[] = { DEFINT(TV_MIN_FREQ,TV_MAX_FREQ), /* Hook in check for input value (tv/radio) and adjust max/min values accordingly */ + .check_value = ctrl_freq_check, .get_max_value = ctrl_freq_max_get, .get_min_value = ctrl_freq_min_get, },{ |