From 3770be34199ace8c497ce454cebd7d63347dc4c3 Mon Sep 17 00:00:00 2001 From: Luca Risolia Date: Wed, 13 Jun 2007 14:37:50 -0300 Subject: V4L/DVB (5765): SN9C1xx driver updates - Add support for pair OV7630+SN9C120 - Better and safe locking mechanism of the device structure on open(), close() and disconnect() - Use kref for handling device deallocation - Generic cleanups Signed-off-by: Luca Risolia Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/sn9c102/sn9c102.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/media/video/sn9c102/sn9c102.h') diff --git a/drivers/media/video/sn9c102/sn9c102.h b/drivers/media/video/sn9c102/sn9c102.h index 11fcb49f5b9..2e3c3de793a 100644 --- a/drivers/media/video/sn9c102/sn9c102.h +++ b/drivers/media/video/sn9c102/sn9c102.h @@ -36,6 +36,7 @@ #include #include #include +#include #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; }; /*****************************************************************************/ -- cgit v1.2.3