Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22074
b: refs/heads/master
c: ccad778
h: refs/heads/master
v: v3
  • Loading branch information
Luca Risolia authored and Greg Kroah-Hartman committed Mar 20, 2006
1 parent 62a99a6 commit 97c50ff
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 162 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ffab02fea5880da284dc5511479b25a796a8dee
refs/heads/master: ccad7789d5e557644d1c866b018394872af0ec5b
10 changes: 9 additions & 1 deletion trunk/Documentation/usb/et61x251.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ Description: Force the application to unmap previously mapped buffer memory
1 = force memory unmapping (save memory)
Default: 0
-------------------------------------------------------------------------------
Name: frame_timeout
Type: uint array (min = 0, max = 64)
Syntax: <n[,...]>
Description: Timeout for a video frame in seconds. This parameter is
specific for each detected camera. This parameter can be
changed at runtime thanks to the /sys filesystem interface.
Default: 2
-------------------------------------------------------------------------------
Name: debug
Type: ushort
Syntax: <n>
Expand Down Expand Up @@ -266,7 +274,7 @@ the V4L2 interface.


10. Notes for V4L2 application developers
========================================
=========================================
This driver follows the V4L2 API specifications. In particular, it enforces two
rules:

Expand Down
28 changes: 21 additions & 7 deletions trunk/drivers/usb/media/et61x251.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
#include <linux/types.h>
#include <linux/param.h>
#include <linux/rwsem.h>
#include <asm/semaphore.h>
#include <linux/mutex.h>
#include <linux/stddef.h>
#include <linux/string.h>

#include "et61x251_sensor.h"

Expand All @@ -51,6 +53,7 @@
#define ET61X251_ALTERNATE_SETTING 13
#define ET61X251_URB_TIMEOUT msecs_to_jiffies(2 * ET61X251_ISO_PACKETS)
#define ET61X251_CTRL_TIMEOUT 100
#define ET61X251_FRAME_TIMEOUT 2

/*****************************************************************************/

Expand Down Expand Up @@ -127,15 +130,16 @@ struct et61x251_sysfs_attr {

struct et61x251_module_param {
u8 force_munmap;
u16 frame_timeout;
};

static DECLARE_MUTEX(et61x251_sysfs_lock);
static DEFINE_MUTEX(et61x251_sysfs_lock);
static DECLARE_RWSEM(et61x251_disconnect);

struct et61x251_device {
struct video_device* v4ldev;

struct et61x251_sensor* sensor;
struct et61x251_sensor sensor;

struct usb_device* usbdev;
struct urb* urb[ET61X251_URBS];
Expand All @@ -157,19 +161,28 @@ struct et61x251_device {
enum et61x251_dev_state state;
u8 users;

struct semaphore dev_sem, fileop_sem;
struct mutex dev_mutex, fileop_mutex;
spinlock_t queue_lock;
wait_queue_head_t open, wait_frame, wait_stream;
};

/*****************************************************************************/

struct et61x251_device*
et61x251_match_id(struct et61x251_device* cam, const struct usb_device_id *id)
{
if (usb_match_id(usb_ifnum_to_if(cam->usbdev, 0), id))
return cam;

return NULL;
}


void
et61x251_attach_sensor(struct et61x251_device* cam,
struct et61x251_sensor* sensor)
{
cam->sensor = sensor;
cam->sensor->usbdev = cam->usbdev;
memcpy(&cam->sensor, sensor, sizeof(struct et61x251_sensor));
}

/*****************************************************************************/
Expand Down Expand Up @@ -212,7 +225,8 @@ do { \

#undef PDBG
#define PDBG(fmt, args...) \
dev_info(&cam->dev, "[%s:%d] " fmt "\n", __FUNCTION__, __LINE__ , ## args)
dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \
__FUNCTION__, __LINE__ , ## args)

#undef PDBGG
#define PDBGG(fmt, args...) do {;} while(0) /* placeholder */
Expand Down
Loading

0 comments on commit 97c50ff

Please sign in to comment.