aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-hdw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c10
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
384static 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
384static int ctrl_freq_max_get(struct pvr2_ctrl *cptr, int *vp) 393static 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 },{