Commit 176c2f34 authored by Jean Delvare's avatar Jean Delvare Committed by Mauro Carvalho Chehab

V4L/DVB (8956): bttv: Turn video_nr, vbi_nr and radio_nr into arrays

With video_nr, vbi_nr and radio_nr being simple integers, it is not
possible to use these parameters on a system with multiple bttv
adapters (which happens to be my case.) video_register_device() will
always fail on the second and later adapters. Turn these parameters
into arrays, as many other V4L drivers are already doing, so that they
can be used on such systems.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c87994db
...@@ -76,9 +76,9 @@ static unsigned int gbuffers = 8; ...@@ -76,9 +76,9 @@ static unsigned int gbuffers = 8;
static unsigned int gbufsize = 0x208000; static unsigned int gbufsize = 0x208000;
static unsigned int reset_crop = 1; static unsigned int reset_crop = 1;
static int video_nr = -1; static int video_nr[BTTV_MAX] = { [0 ... (BTTV_MAX-1)] = -1 };
static int radio_nr = -1; static int radio_nr[BTTV_MAX] = { [0 ... (BTTV_MAX-1)] = -1 };
static int vbi_nr = -1; static int vbi_nr[BTTV_MAX] = { [0 ... (BTTV_MAX-1)] = -1 };
static int debug_latency; static int debug_latency;
static unsigned int fdsr; static unsigned int fdsr;
...@@ -108,9 +108,6 @@ module_param(irq_debug, int, 0644); ...@@ -108,9 +108,6 @@ module_param(irq_debug, int, 0644);
module_param(debug_latency, int, 0644); module_param(debug_latency, int, 0644);
module_param(fdsr, int, 0444); module_param(fdsr, int, 0444);
module_param(video_nr, int, 0444);
module_param(radio_nr, int, 0444);
module_param(vbi_nr, int, 0444);
module_param(gbuffers, int, 0444); module_param(gbuffers, int, 0444);
module_param(gbufsize, int, 0444); module_param(gbufsize, int, 0444);
module_param(reset_crop, int, 0444); module_param(reset_crop, int, 0444);
...@@ -131,6 +128,9 @@ module_param(full_luma_range, int, 0444); ...@@ -131,6 +128,9 @@ module_param(full_luma_range, int, 0444);
module_param(coring, int, 0444); module_param(coring, int, 0444);
module_param_array(radio, int, NULL, 0444); module_param_array(radio, int, NULL, 0444);
module_param_array(video_nr, int, NULL, 0444);
module_param_array(radio_nr, int, NULL, 0444);
module_param_array(vbi_nr, int, NULL, 0444);
MODULE_PARM_DESC(radio,"The TV card supports radio, default is 0 (no)"); MODULE_PARM_DESC(radio,"The TV card supports radio, default is 0 (no)");
MODULE_PARM_DESC(bigendian,"byte order of the framebuffer, default is native endian"); MODULE_PARM_DESC(bigendian,"byte order of the framebuffer, default is native endian");
...@@ -152,6 +152,9 @@ MODULE_PARM_DESC(irq_iswitch,"switch inputs in irq handler"); ...@@ -152,6 +152,9 @@ MODULE_PARM_DESC(irq_iswitch,"switch inputs in irq handler");
MODULE_PARM_DESC(uv_ratio,"ratio between u and v gains, default is 50"); MODULE_PARM_DESC(uv_ratio,"ratio between u and v gains, default is 50");
MODULE_PARM_DESC(full_luma_range,"use the full luma range, default is 0 (no)"); MODULE_PARM_DESC(full_luma_range,"use the full luma range, default is 0 (no)");
MODULE_PARM_DESC(coring,"set the luma coring level, default is 0 (no)"); MODULE_PARM_DESC(coring,"set the luma coring level, default is 0 (no)");
MODULE_PARM_DESC(video_nr, "video device numbers");
MODULE_PARM_DESC(vbi_nr, "vbi device numbers");
MODULE_PARM_DESC(radio_nr, "radio device numbers");
MODULE_DESCRIPTION("bttv - v4l/v4l2 driver module for bt848/878 based cards"); MODULE_DESCRIPTION("bttv - v4l/v4l2 driver module for bt848/878 based cards");
MODULE_AUTHOR("Ralph Metzler & Marcus Metzler & Gerd Knorr"); MODULE_AUTHOR("Ralph Metzler & Marcus Metzler & Gerd Knorr");
...@@ -4252,7 +4255,8 @@ static int __devinit bttv_register_video(struct bttv *btv) ...@@ -4252,7 +4255,8 @@ static int __devinit bttv_register_video(struct bttv *btv)
if (NULL == btv->video_dev) if (NULL == btv->video_dev)
goto err; goto err;
if (video_register_device(btv->video_dev,VFL_TYPE_GRABBER,video_nr)<0) if (video_register_device(btv->video_dev, VFL_TYPE_GRABBER,
video_nr[btv->c.nr]) < 0)
goto err; goto err;
printk(KERN_INFO "bttv%d: registered device video%d\n", printk(KERN_INFO "bttv%d: registered device video%d\n",
btv->c.nr,btv->video_dev->minor & 0x1f); btv->c.nr,btv->video_dev->minor & 0x1f);
...@@ -4268,7 +4272,8 @@ static int __devinit bttv_register_video(struct bttv *btv) ...@@ -4268,7 +4272,8 @@ static int __devinit bttv_register_video(struct bttv *btv)
if (NULL == btv->vbi_dev) if (NULL == btv->vbi_dev)
goto err; goto err;
if (video_register_device(btv->vbi_dev,VFL_TYPE_VBI,vbi_nr)<0) if (video_register_device(btv->vbi_dev, VFL_TYPE_VBI,
vbi_nr[btv->c.nr]) < 0)
goto err; goto err;
printk(KERN_INFO "bttv%d: registered device vbi%d\n", printk(KERN_INFO "bttv%d: registered device vbi%d\n",
btv->c.nr,btv->vbi_dev->minor & 0x1f); btv->c.nr,btv->vbi_dev->minor & 0x1f);
...@@ -4279,7 +4284,8 @@ static int __devinit bttv_register_video(struct bttv *btv) ...@@ -4279,7 +4284,8 @@ static int __devinit bttv_register_video(struct bttv *btv)
btv->radio_dev = vdev_init(btv, &radio_template, "radio"); btv->radio_dev = vdev_init(btv, &radio_template, "radio");
if (NULL == btv->radio_dev) if (NULL == btv->radio_dev)
goto err; goto err;
if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO,radio_nr)<0) if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO,
radio_nr[btv->c.nr]) < 0)
goto err; goto err;
printk(KERN_INFO "bttv%d: registered device radio%d\n", printk(KERN_INFO "bttv%d: registered device radio%d\n",
btv->c.nr,btv->radio_dev->minor & 0x1f); btv->c.nr,btv->radio_dev->minor & 0x1f);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment