]> err.no Git - linux-2.6/blobdiff - drivers/media/video/usbvideo/vicam.c
Pull sony into release branch
[linux-2.6] / drivers / media / video / usbvideo / vicam.c
index 1d06e53ec7c59269f0b1ca4a5bda550af7d34f3f..876fd276824215d35b29e3a539642c80a1df0e15 100644 (file)
@@ -7,6 +7,7 @@
  *                    Monroe Williams (monroe@pobox.com)
  *
  * Supports 3COM HomeConnect PC Digital WebCam
+ * Supports Compro PS39U WebCam
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -60,6 +61,8 @@
 /* Define these values to match your device */
 #define USB_VICAM_VENDOR_ID    0x04c1
 #define USB_VICAM_PRODUCT_ID   0x009d
+#define USB_COMPRO_VENDOR_ID   0x0602
+#define USB_COMPRO_PRODUCT_ID  0x1001
 
 #define VICAM_BYTES_PER_PIXEL   3
 #define VICAM_MAX_READ_SIZE     (512*242+128)
 #define VICAM_HEADER_SIZE       64
 
 #define clamp( x, l, h )        max_t( __typeof__( x ),         \
-                                       ( l ),                   \
-                                       min_t( __typeof__( x ),  \
-                                              ( h ),            \
-                                              ( x ) ) )
+                                      ( l ),                   \
+                                      min_t( __typeof__( x ),  \
+                                             ( h ),            \
+                                             ( x ) ) )
 
 /* Not sure what all the bytes in these char
  * arrays do, but they're necessary to make
@@ -357,7 +360,7 @@ static unsigned char setup5[] = {
  * Not sure why these are not yet non-statics which I can reference through
  * usbvideo.h the same as it is in 2.4.20.  I bet this will get fixed sometime
  * in the future.
- * 
+ *
 */
 static void *rvmalloc(unsigned long size)
 {
@@ -603,12 +606,12 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
        case VIDIOCSPICT:
                {
                        struct video_picture vp;
-                       
+
                        if (copy_from_user(&vp, user_arg, sizeof(vp))) {
                                retval = -EFAULT;
                                break;
                        }
-                       
+
                        DBG("VIDIOCSPICT depth = %d, pal = %d\n", vp.depth,
                            vp.palette);
 
@@ -655,7 +658,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
                        }
 
                        DBG("VIDIOCSWIN %d x %d\n", vw.width, vw.height);
-                       
+
                        if ( vw.width != 320 || vw.height != 240 )
                                retval = -EFAULT;
 
@@ -809,12 +812,12 @@ vicam_open(struct inode *inode, struct file *file)
        cam->needsDummyRead = 1;
        cam->open_count++;
 
-       file->private_data = cam;       
-       
+       file->private_data = cam;
+
        return 0;
 }
 
-static int 
+static int
 vicam_close(struct inode *inode, struct file *file)
 {
        struct vicam_camera *cam = file->private_data;
@@ -1187,7 +1190,7 @@ vicam_create_proc_entry(struct vicam_camera *cam)
 
        if ( !cam->proc_dir )
                return; // FIXME: We should probably return an error here
-       
+
        ent = create_proc_entry("shutter", S_IFREG | S_IRUGO | S_IWUSR,
                                cam->proc_dir);
        if (ent) {
@@ -1231,7 +1234,7 @@ static inline void vicam_create_proc_entry(struct vicam_camera *cam) { }
 static inline void vicam_destroy_proc_entry(void *ptr) { }
 #endif
 
-static struct file_operations vicam_fops = {
+static const struct file_operations vicam_fops = {
        .owner          = THIS_MODULE,
        .open           = vicam_open,
        .release        = vicam_close,
@@ -1254,6 +1257,7 @@ static struct video_device vicam_template = {
 /* table of devices that work with this driver */
 static struct usb_device_id vicam_table[] = {
        {USB_DEVICE(USB_VICAM_VENDOR_ID, USB_VICAM_PRODUCT_ID)},
+       {USB_DEVICE(USB_COMPRO_VENDOR_ID, USB_COMPRO_PRODUCT_ID)},
        {}                      /* Terminating entry */
 };
 
@@ -1282,7 +1286,7 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
        const struct usb_host_interface *interface;
        const struct usb_endpoint_descriptor *endpoint;
        struct vicam_camera *cam;
-       
+
        printk(KERN_INFO "ViCam based webcam connected\n");
 
        interface = intf->cur_altsetting;
@@ -1331,7 +1335,7 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
        printk(KERN_INFO "ViCam webcam driver now controlling video device %d\n",cam->vdev.minor);
 
        usb_set_intfdata (intf, cam);
-       
+
        return 0;
 }