diff options
Diffstat (limited to 'linux/drivers/media/video/zc0301/zc0301.h')
-rw-r--r-- | linux/drivers/media/video/zc0301/zc0301.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/linux/drivers/media/video/zc0301/zc0301.h b/linux/drivers/media/video/zc0301/zc0301.h index c720ace98..6a944c658 100644 --- a/linux/drivers/media/video/zc0301/zc0301.h +++ b/linux/drivers/media/video/zc0301/zc0301.h @@ -39,6 +39,7 @@ #include <linux/rwsem.h> #include <linux/stddef.h> #include <linux/string.h> +#include <linux/kref.h> #include "zc0301_sensor.h" @@ -101,7 +102,7 @@ struct zc0301_module_param { u16 frame_timeout; }; -static DECLARE_RWSEM(zc0301_disconnect); +static DECLARE_RWSEM(zc0301_dev_lock); struct zc0301_device { struct video_device* v4ldev; @@ -124,16 +125,18 @@ struct zc0301_device { struct zc0301_module_param module_param; + struct kref kref; enum zc0301_dev_state state; u8 users; + struct completion probe; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) - struct mutex dev_mutex, fileop_mutex; + struct mutex open_mutex, fileop_mutex; #else - struct semaphore dev_mutex, fileop_mutex; + struct semaphore open_mutex, fileop_mutex; #endif spinlock_t queue_lock; - wait_queue_head_t open, wait_frame, wait_stream; + wait_queue_head_t wait_open, wait_frame, wait_stream; }; /*****************************************************************************/ @@ -163,8 +166,8 @@ do { \ else if ((level) == 2) \ dev_info(&cam->usbdev->dev, fmt "\n", ## args); \ else if ((level) >= 3) \ - dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ - __FUNCTION__, __LINE__ , ## args); \ + dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n", \ + __FILE__, __FUNCTION__, __LINE__ , ## args); \ } \ } while (0) # define KDBG(level, fmt, args...) \ @@ -173,8 +176,8 @@ do { \ if ((level) == 1 || (level) == 2) \ pr_info("zc0301: " fmt "\n", ## args); \ else if ((level) == 3) \ - pr_debug("zc0301: [%s:%d] " fmt "\n", __FUNCTION__, \ - __LINE__ , ## args); \ + pr_debug("sn9c102: [%s:%s:%d] " fmt "\n", __FILE__, \ + __FUNCTION__, __LINE__ , ## args); \ } \ } while (0) # define V4LDBG(level, name, cmd) \ @@ -190,8 +193,8 @@ do { \ #undef PDBG #define PDBG(fmt, args...) \ -dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ - __FUNCTION__, __LINE__ , ## args) +dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n", __FILE__, __FUNCTION__, \ + __LINE__ , ## args) #undef PDBGG #define PDBGG(fmt, args...) do {;} while(0) /* placeholder */ |