diff options
author | Mike Isely <isely@pobox.com> | 2006-12-27 21:28:54 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:34:33 -0500 |
commit | 5549f54f46c2375761f42cd2741364316e3b2a13 (patch) | |
tree | bd4d19a7ba79824c4eb0d9c4f27c07b5a4acf82c /drivers/media/video/pvrusb2/pvrusb2-hdw.c | |
parent | 2083230084cee50580ee730cd26669704f7939b9 (diff) |
V4L/DVB (5050): Pvrusb2: Newer frequency range checking
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index fe290f2f4e14..04e746932217 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -381,6 +381,15 @@ static int ctrl_vres_min_get(struct pvr2_ctrl *cptr,int *vp) | |||
381 | return 0; | 381 | return 0; |
382 | } | 382 | } |
383 | 383 | ||
384 | static int ctrl_freq_check(struct pvr2_ctrl *cptr,int v) | ||
385 | { | ||
386 | if (cptr->hdw->input_val == PVR2_CVAL_INPUT_RADIO) { | ||
387 | return ((v >= RADIO_MIN_FREQ) && (v <= RADIO_MAX_FREQ)); | ||
388 | } else { | ||
389 | return ((v >= TV_MIN_FREQ) && (v <= TV_MAX_FREQ)); | ||
390 | } | ||
391 | } | ||
392 | |||
384 | static int ctrl_freq_max_get(struct pvr2_ctrl *cptr, int *vp) | 393 | static int ctrl_freq_max_get(struct pvr2_ctrl *cptr, int *vp) |
385 | { | 394 | { |
386 | /* Actual maximum depends on radio/tv mode */ | 395 | /* Actual maximum depends on radio/tv mode */ |
@@ -788,6 +797,7 @@ static const struct pvr2_ctl_info control_defs[] = { | |||
788 | DEFINT(TV_MIN_FREQ,TV_MAX_FREQ), | 797 | DEFINT(TV_MIN_FREQ,TV_MAX_FREQ), |
789 | /* Hook in check for input value (tv/radio) and adjust | 798 | /* Hook in check for input value (tv/radio) and adjust |
790 | max/min values accordingly */ | 799 | max/min values accordingly */ |
800 | .check_value = ctrl_freq_check, | ||
791 | .get_max_value = ctrl_freq_max_get, | 801 | .get_max_value = ctrl_freq_max_get, |
792 | .get_min_value = ctrl_freq_min_get, | 802 | .get_min_value = ctrl_freq_min_get, |
793 | },{ | 803 | },{ |