Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
[pandora-kernel.git] / drivers / media / video / em28xx / em28xx-core.c
index a41cc55..331e1ca 100644 (file)
@@ -782,11 +782,15 @@ int em28xx_resolution_set(struct em28xx *dev)
 
        em28xx_accumulator_set(dev, 1, (width - 4) >> 2, 1, (height - 4) >> 2);
 
-       /* If we don't set the start position to 4 in VBI mode, we end up
-          with line 21 being YUYV encoded instead of being in 8-bit
-          greyscale */
+       /* If we don't set the start position to 2 in VBI mode, we end up
+          with line 20/21 being YUYV encoded instead of being in 8-bit
+          greyscale.  The core of the issue is that line 21 (and line 23 for
+          PAL WSS) are inside of active video region, and as a result they
+          get the pixelformatting associated with that area.  So by cropping
+          it out, we end up with the same format as the rest of the VBI
+          region */
        if (em28xx_vbi_supported(dev) == 1)
-               em28xx_capture_area_set(dev, 0, 4, width >> 2, height >> 2);
+               em28xx_capture_area_set(dev, 0, 2, width >> 2, height >> 2);
        else
                em28xx_capture_area_set(dev, 0, 0, width >> 2, height >> 2);
 
@@ -966,7 +970,7 @@ void em28xx_uninit_isoc(struct em28xx *dev)
                                usb_unlink_urb(urb);
 
                        if (dev->isoc_ctl.transfer_buffer[i]) {
-                               usb_buffer_free(dev->udev,
+                               usb_free_coherent(dev->udev,
                                        urb->transfer_buffer_length,
                                        dev->isoc_ctl.transfer_buffer[i],
                                        urb->transfer_dma);
@@ -1041,7 +1045,7 @@ int em28xx_init_isoc(struct em28xx *dev, int max_packets,
                }
                dev->isoc_ctl.urb[i] = urb;
 
-               dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->udev,
+               dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->udev,
                        sb_size, GFP_KERNEL, &urb->transfer_dma);
                if (!dev->isoc_ctl.transfer_buffer[i]) {
                        em28xx_err("unable to allocate %i bytes for transfer"
@@ -1174,21 +1178,18 @@ void em28xx_add_into_devlist(struct em28xx *dev)
  */
 
 static LIST_HEAD(em28xx_extension_devlist);
-static DEFINE_MUTEX(em28xx_extension_devlist_lock);
 
 int em28xx_register_extension(struct em28xx_ops *ops)
 {
        struct em28xx *dev = NULL;
 
        mutex_lock(&em28xx_devlist_mutex);
-       mutex_lock(&em28xx_extension_devlist_lock);
        list_add_tail(&ops->next, &em28xx_extension_devlist);
        list_for_each_entry(dev, &em28xx_devlist, devlist) {
                if (dev)
                        ops->init(dev);
        }
        printk(KERN_INFO "Em28xx: Initialized (%s) extension\n", ops->name);
-       mutex_unlock(&em28xx_extension_devlist_lock);
        mutex_unlock(&em28xx_devlist_mutex);
        return 0;
 }
@@ -1204,10 +1205,8 @@ void em28xx_unregister_extension(struct em28xx_ops *ops)
                        ops->fini(dev);
        }
 
-       mutex_lock(&em28xx_extension_devlist_lock);
        printk(KERN_INFO "Em28xx: Removed (%s) extension\n", ops->name);
        list_del(&ops->next);
-       mutex_unlock(&em28xx_extension_devlist_lock);
        mutex_unlock(&em28xx_devlist_mutex);
 }
 EXPORT_SYMBOL(em28xx_unregister_extension);
@@ -1216,26 +1215,26 @@ void em28xx_init_extension(struct em28xx *dev)
 {
        struct em28xx_ops *ops = NULL;
 
-       mutex_lock(&em28xx_extension_devlist_lock);
+       mutex_lock(&em28xx_devlist_mutex);
        if (!list_empty(&em28xx_extension_devlist)) {
                list_for_each_entry(ops, &em28xx_extension_devlist, next) {
                        if (ops->init)
                                ops->init(dev);
                }
        }
-       mutex_unlock(&em28xx_extension_devlist_lock);
+       mutex_unlock(&em28xx_devlist_mutex);
 }
 
 void em28xx_close_extension(struct em28xx *dev)
 {
        struct em28xx_ops *ops = NULL;
 
-       mutex_lock(&em28xx_extension_devlist_lock);
+       mutex_lock(&em28xx_devlist_mutex);
        if (!list_empty(&em28xx_extension_devlist)) {
                list_for_each_entry(ops, &em28xx_extension_devlist, next) {
                        if (ops->fini)
                                ops->fini(dev);
                }
        }
-       mutex_unlock(&em28xx_extension_devlist_lock);
+       mutex_unlock(&em28xx_devlist_mutex);
 }