aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2006-12-27 21:17:26 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:34:29 -0500
commit5e6862cefe004f0f7ad86e0a80df4d9465576903 (patch)
tree7ad46003d31bdd3df1f2421a8a70e1218d579f79 /drivers
parentf5156b06acaad13b74f72bf62025de7b76b1b8a4 (diff)
V4L/DVB (5044): Pvrusb2: Allow overriding vbi and radio device minor numbers
Support specification of vbi and radio device minor numbers in a manner similar to the video device minor number. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 3a2a0ca33e90..28187fbb5414 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -71,7 +71,13 @@ struct pvr2_v4l2 {
71 71
72static int video_nr[PVR_NUM] = {[0 ... PVR_NUM-1] = -1}; 72static int video_nr[PVR_NUM] = {[0 ... PVR_NUM-1] = -1};
73module_param_array(video_nr, int, NULL, 0444); 73module_param_array(video_nr, int, NULL, 0444);
74MODULE_PARM_DESC(video_nr, "Offset for device's minor"); 74MODULE_PARM_DESC(video_nr, "Offset for device's video dev minor");
75static int radio_nr[PVR_NUM] = {[0 ... PVR_NUM-1] = -1};
76module_param_array(radio_nr, int, NULL, 0444);
77MODULE_PARM_DESC(radio_nr, "Offset for device's radio dev minor");
78static int vbi_nr[PVR_NUM] = {[0 ... PVR_NUM-1] = -1};
79module_param_array(vbi_nr, int, NULL, 0444);
80MODULE_PARM_DESC(vbi_nr, "Offset for device's vbi dev minor");
75 81
76static struct v4l2_capability pvr_capability ={ 82static struct v4l2_capability pvr_capability ={
77 .driver = "pvrusb2", 83 .driver = "pvrusb2",
@@ -1113,7 +1119,18 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
1113 mindevnum = -1; 1119 mindevnum = -1;
1114 unit_number = pvr2_hdw_get_unit_number(vp->channel.mc_head->hdw); 1120 unit_number = pvr2_hdw_get_unit_number(vp->channel.mc_head->hdw);
1115 if ((unit_number >= 0) && (unit_number < PVR_NUM)) { 1121 if ((unit_number >= 0) && (unit_number < PVR_NUM)) {
1116 mindevnum = video_nr[unit_number]; 1122 switch (v4l_type) {
1123 case VFL_TYPE_VBI:
1124 mindevnum = vbi_nr[unit_number];
1125 break;
1126 case VFL_TYPE_RADIO:
1127 mindevnum = radio_nr[unit_number];
1128 break;
1129 case VFL_TYPE_GRABBER:
1130 default:
1131 mindevnum = video_nr[unit_number];
1132 break;
1133 }
1117 } 1134 }
1118 if ((video_register_device(&dip->devbase, v4l_type, mindevnum) < 0) && 1135 if ((video_register_device(&dip->devbase, v4l_type, mindevnum) < 0) &&
1119 (video_register_device(&dip->devbase, v4l_type, -1) < 0)) { 1136 (video_register_device(&dip->devbase, v4l_type, -1) < 0)) {
@@ -1122,17 +1139,18 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
1122 switch (cfg) { 1139 switch (cfg) {
1123 case pvr2_config_mpeg: 1140 case pvr2_config_mpeg:
1124 printk(KERN_INFO "pvrusb2: registered device video%d [%s]\n", 1141 printk(KERN_INFO "pvrusb2: registered device video%d [%s]\n",
1125 dip->devbase.minor,pvr2_config_get_name(dip->config)); 1142 dip->devbase.minor & 0x1f,
1143 pvr2_config_get_name(dip->config));
1126 break; 1144 break;
1127 case pvr2_config_vbi: 1145 case pvr2_config_vbi:
1128 printk(KERN_INFO "pvrusb2: registered device vbi%d [%s]\n", 1146 printk(KERN_INFO "pvrusb2: registered device vbi%d [%s]\n",
1129 dip->devbase.minor - MINOR_VFL_TYPE_VBI_MIN, 1147 dip->devbase.minor & 0x1f,
1130 pvr2_config_get_name(dip->config)); 1148 pvr2_config_get_name(dip->config));
1131 break; 1149 break;
1132 case pvr2_config_radio: 1150 case pvr2_config_radio:
1133 printk(KERN_INFO "pvrusb2: registered device radio%d [%s]\n", 1151 printk(KERN_INFO "pvrusb2: registered device radio%d [%s]\n",
1134 dip->devbase.minor - MINOR_VFL_TYPE_RADIO_MIN, 1152 dip->devbase.minor & 0x1f,
1135 pvr2_config_get_name(dip->config)); 1153 pvr2_config_get_name(dip->config));
1136 break; 1154 break;
1137 default: 1155 default:
1138 break; 1156 break;