MODULE_AUTHOR("Jeroen Vreeken <pe1rxq@amsat.org>");
MODULE_DESCRIPTION("SE401 USB Camera Driver");
MODULE_LICENSE("GPL");
-MODULE_PARM(flickerless, "i");
+module_param(flickerless, int, 0);
MODULE_PARM_DESC(flickerless, "Net frequency to adjust exposure time to (0/50/60)");
-MODULE_PARM(video_nr, "i");
+module_param(video_nr, int, 0);
static struct usb_driver se401_driver;
* Memory management
*
**********************************************************************/
-
-/* Here we want the physical address of the memory.
- * This is used when initializing the contents of the area.
- */
-static inline unsigned long kvirt_to_pa(unsigned long adr)
-{
- unsigned long kva, ret;
-
- kva = (unsigned long) page_address(vmalloc_to_page((void *)adr));
- kva |= adr & (PAGE_SIZE-1); /* restore the offset */
- ret = __pa(kva);
- return ret;
-}
-
static void *rvmalloc(unsigned long size)
{
void *mem;
0,
cp,
size,
- HZ
+ 1000
);
}
selector,
NULL,
0,
- HZ
+ 1000
);
}
selector,
cp,
2,
- HZ
+ 1000
);
return cp[0]+cp[1]*256;
}
se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 0, NULL, 0);
for (i=0; i<SE401_NUMSBUF; i++) if (se401->urb[i]) {
- usb_unlink_urb(se401->urb[i]);
+ usb_kill_urb(se401->urb[i]);
usb_free_urb(se401->urb[i]);
se401->urb[i]=NULL;
kfree(se401->sbuf[i].data);
se401->dev = NULL;
- for (i=0; i<SE401_NUMSBUF; i++) if (se401->urb[i]) {
- usb_unlink_urb(se401->urb[i]);
- usb_free_urb(se401->urb[i]);
- se401->urb[i] = NULL;
- kfree(se401->sbuf[i].data);
- }
- for (i=0; i<SE401_NUMSCRATCH; i++) if (se401->scratch[i].data) {
+ for (i=0; i<SE401_NUMSBUF; i++)
+ if (se401->urb[i]) {
+ usb_kill_urb(se401->urb[i]);
+ usb_free_urb(se401->urb[i]);
+ se401->urb[i] = NULL;
+ kfree(se401->sbuf[i].data);
+ }
+ for (i=0; i<SE401_NUMSCRATCH; i++) {
kfree(se401->scratch[i].data);
}
if (se401->inturb) {
- usb_unlink_urb(se401->inturb);
+ usb_kill_urb(se401->inturb);
usb_free_urb(se401->inturb);
}
info("%s disconnected", se401->camera_name);
return video_usercopy(inode, file, cmd, arg, se401_do_ioctl);
}
-static ssize_t se401_read(struct file *file, char *buf,
+static ssize_t se401_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
int realcount=count, ret=0;
}
pos = (unsigned long)se401->fbuf;
while (size > 0) {
- page = kvirt_to_pa(pos);
- if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED)) {
+ page = vmalloc_to_pfn((void *)pos);
+ if (remap_pfn_range(vma, start, page, PAGE_SIZE, PAGE_SHARED)) {
up(&se401->lock);
return -EAGAIN;
}
.read = se401_read,
.mmap = se401_mmap,
.ioctl = se401_ioctl,
+ .compat_ioctl = v4l_compat_ioctl32,
.llseek = no_llseek,
};
static struct video_device se401_template = {
&se401->button, sizeof(se401->button),
se401_button_irq,
se401,
- HZ/10
+ 8
);
if (usb_submit_urb(se401->inturb, GFP_KERNEL)) {
info("int urb burned down");
interface = &intf->cur_altsetting->desc;
/* Is it an se401? */
- if (dev->descriptor.idVendor == 0x03e8 &&
- dev->descriptor.idProduct == 0x0004) {
+ if (le16_to_cpu(dev->descriptor.idVendor) == 0x03e8 &&
+ le16_to_cpu(dev->descriptor.idProduct) == 0x0004) {
camera_name="Endpoints/Aox SE401";
- } else if (dev->descriptor.idVendor == 0x0471 &&
- dev->descriptor.idProduct == 0x030b) {
+ } else if (le16_to_cpu(dev->descriptor.idVendor) == 0x0471 &&
+ le16_to_cpu(dev->descriptor.idProduct) == 0x030b) {
camera_name="Philips PCVC665K";
- } else if (dev->descriptor.idVendor == 0x047d &&
- dev->descriptor.idProduct == 0x5001) {
+ } else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d &&
+ le16_to_cpu(dev->descriptor.idProduct) == 0x5001) {
camera_name="Kensington VideoCAM 67014";
- } else if (dev->descriptor.idVendor == 0x047d &&
- dev->descriptor.idProduct == 0x5002) {
+ } else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d &&
+ le16_to_cpu(dev->descriptor.idProduct) == 0x5002) {
camera_name="Kensington VideoCAM 6701(5/7)";
- } else if (dev->descriptor.idVendor == 0x047d &&
- dev->descriptor.idProduct == 0x5003) {
+ } else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d &&
+ le16_to_cpu(dev->descriptor.idProduct) == 0x5003) {
camera_name="Kensington VideoCAM 67016";
button=0;
} else
se401->iface = interface->bInterfaceNumber;
se401->camera_name = camera_name;
- info("firmware version: %02x", dev->descriptor.bcdDevice & 255);
+ info("firmware version: %02x", le16_to_cpu(dev->descriptor.bcdDevice) & 255);
if (se401_init(se401, button)) {
kfree(se401);
}
static struct usb_driver se401_driver = {
- .owner = THIS_MODULE,
.name = "se401",
.id_table = device_table,
.probe = se401_probe,