aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-04-22 13:45:39 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:47 -0400
commitdbc40a0e582a88d2561d13d1fea4f3496bff9650 (patch)
treec914495caa3cf85c6487188ecc05a1aa3acfc0ed /drivers/media/video
parentfdf256f3374d5060e3714651b45b8450b7dc4349 (diff)
V4L/DVB (7303): pvrusb2: Ensure that default input selection is actually valid
Previously the pvrusb2 driver just started with the default input to be "television". But if the device doesn't support an analog tuner then this default must be different. New logic here selects a reasonable default based on the actual valid set of available inputs. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c9
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.h4
2 files changed, 11 insertions, 2 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 94cb0a76e77e..ae36948c6c1d 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1875,6 +1875,15 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
1875 cptr = hdw->controls + idx; 1875 cptr = hdw->controls + idx;
1876 cptr->info = control_defs+idx; 1876 cptr->info = control_defs+idx;
1877 } 1877 }
1878
1879 /* Ensure that default input choice is a valid one. */
1880 m = hdw->input_avail_mask;
1881 if (m) for (idx = 0; idx < (sizeof(m) << 3); idx++) {
1882 if (!((1 << idx) & m)) continue;
1883 hdw->input_val = idx;
1884 break;
1885 }
1886
1878 /* Define and configure additional controls from cx2341x module. */ 1887 /* Define and configure additional controls from cx2341x module. */
1879 hdw->mpeg_ctrl_info = kzalloc( 1888 hdw->mpeg_ctrl_info = kzalloc(
1880 sizeof(*(hdw->mpeg_ctrl_info)) * MPEGDEF_COUNT, GFP_KERNEL); 1889 sizeof(*(hdw->mpeg_ctrl_info)) * MPEGDEF_COUNT, GFP_KERNEL);
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/drivers/media/video/pvrusb2/pvrusb2-hdw.h
index 59f385878ef2..2919a1d9ed0f 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.h
@@ -41,8 +41,8 @@
41/* Legal values for the INPUT state variable */ 41/* Legal values for the INPUT state variable */
42#define PVR2_CVAL_INPUT_TV 0 42#define PVR2_CVAL_INPUT_TV 0
43#define PVR2_CVAL_INPUT_DTV 1 43#define PVR2_CVAL_INPUT_DTV 1
44#define PVR2_CVAL_INPUT_SVIDEO 2 44#define PVR2_CVAL_INPUT_COMPOSITE 2
45#define PVR2_CVAL_INPUT_COMPOSITE 3 45#define PVR2_CVAL_INPUT_SVIDEO 3
46#define PVR2_CVAL_INPUT_RADIO 4 46#define PVR2_CVAL_INPUT_RADIO 4
47 47
48enum pvr2_config { 48enum pvr2_config {