Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174158
b: refs/heads/master
c: 0b398f4
h: refs/heads/master
v: v3
  • Loading branch information
Pete Eberlein authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent 0a8b89e commit 1025a95
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 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: 76dd272b56cd1c7fa013ef5d7eb28c4d319e322b
refs/heads/master: 0b398f4f124e2b4b03f9acf726370c8459610c5c
10 changes: 5 additions & 5 deletions trunk/drivers/staging/go7007/go7007-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int go7007_read_interrupt(struct go7007 *go, u16 *value, u16 *data)
go->hpi_ops->read_interrupt(go);
if (wait_event_timeout(go->interrupt_waitq,
go->interrupt_available, 5*HZ) < 0) {
v4l2_err(go->video_dev, "timeout waiting for read interrupt\n");
v4l2_err(&go->v4l2_dev, "timeout waiting for read interrupt\n");
return -1;
}
if (!go->interrupt_available)
Expand Down Expand Up @@ -315,7 +315,7 @@ int go7007_start_encoder(struct go7007 *go)

if (go7007_send_firmware(go, fw, fw_len) < 0 ||
go7007_read_interrupt(go, &intr_val, &intr_data) < 0) {
v4l2_err(go->video_dev, "error transferring firmware\n");
v4l2_err(&go->v4l2_dev, "error transferring firmware\n");
rv = -1;
goto start_error;
}
Expand All @@ -324,7 +324,7 @@ int go7007_start_encoder(struct go7007 *go)
go->parse_length = 0;
go->seen_frame = 0;
if (go7007_stream_start(go) < 0) {
v4l2_err(go->video_dev, "error starting stream transfer\n");
v4l2_err(&go->v4l2_dev, "error starting stream transfer\n");
rv = -1;
goto start_error;
}
Expand Down Expand Up @@ -420,7 +420,7 @@ void go7007_parse_video_stream(struct go7007 *go, u8 *buf, int length)
for (i = 0; i < length; ++i) {
if (go->active_buf != NULL &&
go->active_buf->bytesused >= GO7007_BUF_SIZE - 3) {
v4l2_info(go->video_dev, "dropping oversized frame\n");
v4l2_info(&go->v4l2_dev, "dropping oversized frame\n");
go->active_buf->offset -= go->active_buf->bytesused;
go->active_buf->bytesused = 0;
go->active_buf->modet_active = 0;
Expand Down Expand Up @@ -668,7 +668,7 @@ void go7007_remove(struct go7007 *go)
if (i2c_del_adapter(&go->i2c_adapter) == 0)
go->i2c_adapter_online = 0;
else
v4l2_err(go->video_dev,
v4l2_err(&go->v4l2_dev,
"error removing I2C adapter!\n");
}

Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/staging/go7007/go7007-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* user-space applications.
*/

#include <media/v4l2-device.h>

struct go7007;

/* IDs to activate board-specific support code */
Expand Down Expand Up @@ -167,6 +169,7 @@ struct go7007 {
int channel_number; /* for multi-channel boards like Adlink PCI-MPG24 */
char name[64];
struct video_device *video_dev;
struct v4l2_device v4l2_dev;
int ref_count;
enum { STATUS_INIT, STATUS_ONLINE, STATUS_SHUTDOWN } status;
spinlock_t spinlock;
Expand Down Expand Up @@ -240,6 +243,11 @@ struct go7007 {
unsigned short interrupt_data;
};

static inline struct go7007 *to_go7007(struct v4l2_device *v4l2_dev)
{
return container_of(v4l2_dev, struct go7007, v4l2_dev);
}

/* All of these must be called with the hpi_lock mutex held! */
#define go7007_interface_reset(go) \
((go)->hpi_ops->interface_reset(go))
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/go7007/go7007-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ static int go7007_usb_probe(struct usb_interface *intf,
usb_rcvintpipe(usb->usbdev, 4),
usb->intr_urb->transfer_buffer, 2*sizeof(u16),
go7007_usb_readinterrupt_complete, go, 8);
usb_set_intfdata(intf, go);
usb_set_intfdata(intf, &go->v4l2_dev);

/* Boot the GO7007 */
if (go7007_boot_encoder(go, go->board_info->flags &
Expand Down Expand Up @@ -1233,7 +1233,7 @@ static int go7007_usb_probe(struct usb_interface *intf,

static void go7007_usb_disconnect(struct usb_interface *intf)
{
struct go7007 *go = usb_get_intfdata(intf);
struct go7007 *go = to_go7007(usb_get_intfdata(intf));
struct go7007_usb *usb = go->hpi_context;
struct urb *vurb, *aurb;
int i;
Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/staging/go7007/go7007-v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1827,14 +1827,20 @@ int go7007_v4l2_init(struct go7007 *go)
go->video_dev = video_device_alloc();
if (go->video_dev == NULL)
return -ENOMEM;
memcpy(go->video_dev, &go7007_template, sizeof(go7007_template));
*go->video_dev = go7007_template;
go->video_dev->parent = go->dev;
rv = video_register_device(go->video_dev, VFL_TYPE_GRABBER, -1);
if (rv < 0) {
video_device_release(go->video_dev);
go->video_dev = NULL;
return rv;
}
rv = v4l2_device_register(go->dev, &go->v4l2_dev);
if (rv < 0) {
video_device_release(go->video_dev);
go->video_dev = NULL;
return rv;
}
video_set_drvdata(go->video_dev, go);
++go->ref_count;
printk(KERN_INFO "%s: registered device video%d [v4l2]\n",
Expand All @@ -1858,4 +1864,5 @@ void go7007_v4l2_remove(struct go7007 *go)
mutex_unlock(&go->hw_lock);
if (go->video_dev)
video_unregister_device(go->video_dev);
v4l2_device_unregister(&go->v4l2_dev);
}

0 comments on commit 1025a95

Please sign in to comment.