Skip to contentSkip to conversation

add video_nr module param to gspca

PATCH In review Stas Sergeev 3 participants 5 messages Jan 10, 2009 – Jan 12, 2009 1 message not in the archive Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add video_nr module param to gspca

Hi.

The attached patch adds the module_param for video_nr to the gspca driver.
The patch is completely untested as I don't use any webcam myself. Its just that a friend of mine complained about an inability to set the device number for gspca and I hope this patch can solve that problem.

drivers/media/video/gspca/gspca.c +2 -0
@@ -48,6 +48,8 @@
 #define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 3, 0)
 
 static int video_nr = -1;
+module_param(video_nr, int, 0);
+MODULE_PARM_DESC(video_nr, "video device to register (0=/dev/video0, etc)");
 
 #ifdef GSPCA_DEBUG
 int gspca_debug = D_ERR | D_PROBE;

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#1 lore raw
Quoted 12 lines · On Sat, 10 Jan 2009 21:53:14 +0300 Stas Sergeev <[email protected]> wrote:

Hi.

The attached patch adds the module_param for video_nr to the gspca driver.
The patch is completely untested as I don't use any webcam myself. Its just that a friend of mine complained about an inability to set the device number for gspca and I hope this patch can solve that problem.

Hi,

I don't think such a patch is usefull.

Instead, as every system runs udev, it is simpler to add a rule as:

ATTRS{idVendor}=="05e1",ATTRS{idProduct}=="0893",NAME="video3"

Best regards.

Signature · 7 lines
Ken ar c'hentan	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
#2 lore raw

Hello.

Quoted 3 lines · Jean-Francois Moine

I don't think such a patch is usefull.
Instead, as every system runs udev, it is simpler to add a rule as:
ATTRS{idVendor}=="05e1",ATTRS{idProduct}=="0893",NAME="video3"

Other drivers do have that modparam, namely, I copy/pasted from cpia2_v4l.c. So I thought it would be a good idea to have it at least for consistency, but thanks for the udev hint!

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hi.

Quoted 3 lines · Jean-Francois Moine

Looking at the video drivers, I found that only half of these ones have this parameter. Then, I think it should be better to remove it everywhere!

OK, that might be a solution too. :)

Quoted 3 lines

In fact, setting the video number in the right driver before plugging any video device is rather complicated while setting udev rules is easy and has to be done only once...

No, its not like that. You only add the strings like
options gspca video_nr=1
in your /etc/modprobe.conf, and you are done. ALSA went even further and introduced the option "order", so that you write:
options snd order=snd-intel8x0,snd-hda-intel for example. So, from some point of view, this is actually easier than the udev solution (eg. I always did that and never played with udev :), but indeed, having two ways of doing the same thing is usually confusing, so I am not trying to talk you into applying my patch. :) If there is an intention to deprecate the "video_nr" thing, then it certainly doesn't apply.

#5 lore raw
In reply to Stas Sergeev

Hi Stas,

Please, always copy [email protected] for patches and other subjects related to drivers development. This will allow patchwork.kernel.org to properly track the sent patches.

Cheers,
Mauro.

Quoted 13 lines · On Sat, 10 Jan 2009 21:53:14 +0300 Stas Sergeev <[email protected]> wrote:

Hi.

The attached patch adds the module_param for video_nr to the gspca driver.
The patch is completely untested as I don't use any webcam myself. Its just that a friend of mine complained about an inability to set the device number for gspca and I hope this patch can solve that problem.

Quoted 1 line

Cheers,
Mauro