A second easycap driver implementation
Mauro Carvalho Chehab
mchehab at redhat.com
Wed Mar 7 20:53:13 UTC 2012
Em 07-03-2012 17:39, Ezequiel García escreveu:
> Hi Mauro,
>
>>
>> em28xx is a good reference.
>>
>
> I'm looking at it.
> In fact, I have a first question: why there is a limit to the number of devices
> the driver support? I found the same idea in easycap original
> implementation, but I
> can't understand why do we have to limit in such a way.
>
> /* Check to see next free device and mark as used */
> do {
> nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS);
> if (nr >= EM28XX_MAXBOARDS) {
> /* No free device slots */
> printk(DRIVER_NAME ": Supports only %i em28xx
> boards.\n",
> EM28XX_MAXBOARDS);
> retval = -ENOMEM;
> goto err_no_slot;
> }
> } while (test_and_set_bit(nr, &em28xx_devused));
There are several reasons for that, including a few historical ones. One of them
is that the number of reserved v4l char devices is limited (well, V4L core
now supports dynamic allocation). Another one is a few modprobe arrays for em28xx.
Anyway, an USB 2.0 bus only supports one uncompressed video stream.
>
>
>>
>> It is not clear, from the easycap code, where the I2C address
>> is stored:
>>
>> int write_saa(struct usb_device *p, u16 reg0, u16 set0)
>> {
>> if (!p)
>> return -ENODEV;
>> SET(p, 0x200, 0x00);
>> SET(p, 0x204, reg0);
>> SET(p, 0x205, set0);
>> SET(p, 0x200, 0x01);
>> return wait_i2c(p);
>> }
>
> I think i2c_address it is near registers 0x200/0x204, which gets
> initialised at setup_stk().
> I'll have a closer look.
Ok.
>
> Thanks for your comments,
> Ezequiel.
More information about the devel
mailing list