Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271895
b: refs/heads/master
c: 7b1c8f5
h: refs/heads/master
i:
  271893: 7b5727f
  271891: 8efd7b6
  271887: b89d997
v: v3
  • Loading branch information
Arvydas Sidorenko authored and Mauro Carvalho Chehab committed Sep 24, 2011
1 parent fe2b2ec commit b9e2329
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 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: 69967a71ae6ebe7aace94ef15f269b8bf2b5ce1e
refs/heads/master: 7b1c8f58fcdbed75903943705ef41816e9648c1b
11 changes: 10 additions & 1 deletion trunk/drivers/media/video/stk-webcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ MODULE_AUTHOR("Jaime Velasco Juan <jsagarribay@gmail.com> and Nicolas VIVIEN");
MODULE_DESCRIPTION("Syntek DC1125 webcam driver");


/* bool for webcam LED management */
int first_init = 1;

/* Some cameras have audio interfaces, we aren't interested in those */
static struct usb_device_id stkwebcam_table[] = {
Expand Down Expand Up @@ -560,6 +562,12 @@ static int v4l_stk_open(struct file *fp)

if (dev == NULL || !is_present(dev))
return -ENXIO;

if (!first_init)
stk_camera_write_reg(dev, 0x0, 0x24);
else
first_init = 0;

fp->private_data = dev;
usb_autopm_get_interface(dev->interface);

Expand All @@ -573,7 +581,7 @@ static int v4l_stk_release(struct file *fp)
if (dev->owner == fp) {
stk_stop_stream(dev);
stk_free_buffers(dev);
stk_camera_write_reg(dev, 0x0, 0x48); /* turn off the LED */
stk_camera_write_reg(dev, 0x0, 0x49); /* turn off the LED */
unset_initialised(dev);
dev->owner = NULL;
}
Expand Down Expand Up @@ -1350,6 +1358,7 @@ static int stk_camera_resume(struct usb_interface *intf)
return 0;
unset_initialised(dev);
stk_initialise(dev);
stk_camera_write_reg(dev, 0x0, 0x49);
stk_setup_format(dev);
if (is_streaming(dev))
stk_start_stream(dev);
Expand Down

0 comments on commit b9e2329

Please sign in to comment.