aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/media/sn9c102.h
diff options
context:
space:
mode:
authorLuca Risolia <luca.risolia@studio.unibo.it>2006-02-25 01:50:47 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 17:49:59 -0500
commit2ffab02fea5880da284dc5511479b25a796a8dee (patch)
treeb94481244ae823598d06cd72472b9c76e9639bd1 /drivers/usb/media/sn9c102.h
parent7039f4224d4e40b06308d5c1a97427af1a142459 (diff)
[PATCH] USB: SN9C10x driver updates
SN9C10x driver updates. Changes: + new, - removed, * cleanup, @ bugfix @ Fix stream_interrupt() @ Fix vidioc_enum_input() and split vidioc_gs_input() @ Need usb_get|put_dev() when disconnecting, if the device is open * Use wait_event_interruptible_timeout() instead of wait_event_interruptible() when waiting for video frames * replace wake_up_interruptible(&wait_stream) with wake_up(&wait_stream) * Cleanups and updates in the documentation + Use per-device sensor structures + Add support for PAS202BCA image sensors + Add frame_timeout module parameter Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/media/sn9c102.h')
-rw-r--r--drivers/usb/media/sn9c102.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/usb/media/sn9c102.h b/drivers/usb/media/sn9c102.h
index 59e44be27cb4..1d70a62b9f23 100644
--- a/drivers/usb/media/sn9c102.h
+++ b/drivers/usb/media/sn9c102.h
@@ -34,7 +34,8 @@
34#include <linux/param.h> 34#include <linux/param.h>
35#include <linux/rwsem.h> 35#include <linux/rwsem.h>
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37#include <asm/semaphore.h> 37#include <linux/string.h>
38#include <linux/stddef.h>
38 39
39#include "sn9c102_sensor.h" 40#include "sn9c102_sensor.h"
40 41
@@ -51,6 +52,7 @@
51#define SN9C102_ALTERNATE_SETTING 8 52#define SN9C102_ALTERNATE_SETTING 8
52#define SN9C102_URB_TIMEOUT msecs_to_jiffies(2 * SN9C102_ISO_PACKETS) 53#define SN9C102_URB_TIMEOUT msecs_to_jiffies(2 * SN9C102_ISO_PACKETS)
53#define SN9C102_CTRL_TIMEOUT 300 54#define SN9C102_CTRL_TIMEOUT 300
55#define SN9C102_FRAME_TIMEOUT 2
54 56
55/*****************************************************************************/ 57/*****************************************************************************/
56 58
@@ -108,6 +110,7 @@ struct sn9c102_sysfs_attr {
108 110
109struct sn9c102_module_param { 111struct sn9c102_module_param {
110 u8 force_munmap; 112 u8 force_munmap;
113 u16 frame_timeout;
111}; 114};
112 115
113static DEFINE_MUTEX(sn9c102_sysfs_lock); 116static DEFINE_MUTEX(sn9c102_sysfs_lock);
@@ -117,7 +120,7 @@ struct sn9c102_device {
117 struct video_device* v4ldev; 120 struct video_device* v4ldev;
118 121
119 enum sn9c102_bridge bridge; 122 enum sn9c102_bridge bridge;
120 struct sn9c102_sensor* sensor; 123 struct sn9c102_sensor sensor;
121 124
122 struct usb_device* usbdev; 125 struct usb_device* usbdev;
123 struct urb* urb[SN9C102_URBS]; 126 struct urb* urb[SN9C102_URBS];
@@ -149,12 +152,21 @@ struct sn9c102_device {
149 152
150/*****************************************************************************/ 153/*****************************************************************************/
151 154
155struct sn9c102_device*
156sn9c102_match_id(struct sn9c102_device* cam, const struct usb_device_id *id)
157{
158 if (usb_match_id(usb_ifnum_to_if(cam->usbdev, 0), id))
159 return cam;
160
161 return NULL;
162}
163
164
152void 165void
153sn9c102_attach_sensor(struct sn9c102_device* cam, 166sn9c102_attach_sensor(struct sn9c102_device* cam,
154 struct sn9c102_sensor* sensor) 167 struct sn9c102_sensor* sensor)
155{ 168{
156 cam->sensor = sensor; 169 memcpy(&cam->sensor, sensor, sizeof(struct sn9c102_sensor));
157 cam->sensor->usbdev = cam->usbdev;
158} 170}
159 171
160/*****************************************************************************/ 172/*****************************************************************************/
@@ -197,7 +209,8 @@ do { \
197 209
198#undef PDBG 210#undef PDBG
199#define PDBG(fmt, args...) \ 211#define PDBG(fmt, args...) \
200dev_info(&cam->dev, "[%s:%d] " fmt "\n", __FUNCTION__, __LINE__ , ## args) 212dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \
213 __FUNCTION__, __LINE__ , ## args)
201 214
202#undef PDBGG 215#undef PDBGG
203#define PDBGG(fmt, args...) do {;} while(0) /* placeholder */ 216#define PDBGG(fmt, args...) do {;} while(0) /* placeholder */