Merge to kernel-2.6.20-1.2949.fc6.vs2.2.0.1
[linux-2.6.git] / drivers / media / video / w9968cf.h
similarity index 94%
rename from drivers/usb/media/w9968cf.h
rename to drivers/media/video/w9968cf.h
index 47a6ff7..ec7696e 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/list.h>
 #include <linux/wait.h>
-#include <linux/config.h>
 #include <linux/param.h>
 #include <linux/types.h>
 #include <linux/rwsem.h>
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
 
 #include <media/ovcamchip.h>
 
@@ -61,7 +60,7 @@
 
 /* Maximum data payload sizes in bytes for alternate settings */
 static const u16 wMaxPacketSize[] = {1023, 959, 895, 831, 767, 703, 639, 575,
-                                      511, 447, 383, 319, 255, 191, 127,  63};
+                                     511, 447, 383, 319, 255, 191, 127,  63};
 #define W9968CF_PACKET_SIZE      1023 /* according to wMaxPacketSizes[] */
 #define W9968CF_MIN_PACKET_SIZE  63 /* minimum value */
 #define W9968CF_ISO_PACKETS      5 /* n.of packets for isochronous transfers */
@@ -134,7 +133,7 @@ static const struct w9968cf_format w9968cf_formatlist[] = {
  ****************************************************************************/
 
 #define W9968CF_MODULE_NAME     "V4L driver for W996[87]CF JPEG USB " \
-                                "Dual Mode Camera Chip"
+                               "Dual Mode Camera Chip"
 #define W9968CF_MODULE_VERSION  "1:1.33-basic"
 #define W9968CF_MODULE_AUTHOR   "(C) 2002-2004 Luca Risolia"
 #define W9968CF_AUTHOR_EMAIL    "<luca.risolia@studio.unibo.it>"
@@ -194,14 +193,6 @@ enum w9968cf_vpp_flag {
        VPP_UYVY_TO_RGBX = 0x08,
 };
 
-static struct w9968cf_vpp_t* w9968cf_vpp;
-static DECLARE_WAIT_QUEUE_HEAD(w9968cf_vppmod_wait);
-
-static LIST_HEAD(w9968cf_dev_list); /* head of V4L registered cameras list */
-static DECLARE_MUTEX(w9968cf_devlist_sem); /* semaphore for list traversal */
-
-static DECLARE_RWSEM(w9968cf_disconnect); /* prevent races with open() */
-
 /* Main device driver structure */
 struct w9968cf_device {
        struct device dev; /* device structure */
@@ -277,10 +268,10 @@ struct w9968cf_device {
        struct i2c_client* sensor_client;
 
        /* Locks */
-       struct semaphore dev_sem,    /* for probe, disconnect,open and close */
-                        fileop_sem; /* for read and ioctl */
+       struct mutex dev_mutex,    /* for probe, disconnect,open and close */
+                        fileop_mutex; /* for read and ioctl */
        spinlock_t urb_lock,   /* for submit_urb() and unlink_urb() */
-                  flist_lock; /* for requested frame list accesses */
+                  flist_lock; /* for requested frame list accesses */
        wait_queue_head_t open, wait_queue;
 
        char command[16]; /* name of the program holding the device */
@@ -307,7 +298,7 @@ struct w9968cf_device {
                        dev_warn(&cam->dev, fmt "\n", ## args);               \
                else if ((level) >= 5)                                        \
                        dev_info(&cam->dev, "[%s:%d] " fmt "\n",              \
-                                __FUNCTION__, __LINE__ , ## args);           \
+                                __FUNCTION__, __LINE__ , ## args);           \
        }                                                                     \
 }
 /* For generic kernel (not device specific) messages */
@@ -319,7 +310,7 @@ struct w9968cf_device {
                        pr_info("w9968cf: " fmt "\n", ## args);               \
                else if ((level) >= 5)                                        \
                        pr_debug("w9968cf: [%s:%d] " fmt "\n", __FUNCTION__,  \
-                                __LINE__ , ## args);                         \
+                                __LINE__ , ## args);                         \
        }                                                                     \
 }
 #else