]> err.no Git - linux-2.6/blobdiff - drivers/media/video/sn9c102/sn9c102.h
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney...
[linux-2.6] / drivers / media / video / sn9c102 / sn9c102.h
index 680e74634527ce345ecdb6759cf218b211c17db1..2e3c3de793a72a2161a2bf1c0ca69fd8c3b91b7c 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/mutex.h>
 #include <linux/string.h>
 #include <linux/stddef.h>
+#include <linux/kref.h>
 
 #include "sn9c102_config.h"
 #include "sn9c102_sensor.h"
@@ -94,7 +95,7 @@ struct sn9c102_module_param {
 };
 
 static DEFINE_MUTEX(sn9c102_sysfs_lock);
-static DECLARE_RWSEM(sn9c102_disconnect);
+static DECLARE_RWSEM(sn9c102_dev_lock);
 
 struct sn9c102_device {
        struct video_device* v4ldev;
@@ -122,12 +123,14 @@ struct sn9c102_device {
 
        struct sn9c102_module_param module_param;
 
+       struct kref kref;
        enum sn9c102_dev_state state;
        u8 users;
 
-       struct mutex dev_mutex, fileop_mutex;
+       struct completion probe;
+       struct mutex open_mutex, fileop_mutex;
        spinlock_t queue_lock;
-       wait_queue_head_t open, wait_frame, wait_stream;
+       wait_queue_head_t wait_open, wait_frame, wait_stream;
 };
 
 /*****************************************************************************/
@@ -141,7 +144,7 @@ sn9c102_match_id(struct sn9c102_device* cam, const struct usb_device_id *id)
 
 void
 sn9c102_attach_sensor(struct sn9c102_device* cam,
-                     struct sn9c102_sensor* sensor)
+                     const struct sn9c102_sensor* sensor)
 {
        memcpy(&cam->sensor, sensor, sizeof(struct sn9c102_sensor));
 }