diff options
Diffstat (limited to 'drivers/media/video/stk-webcam.c')
-rw-r--r-- | drivers/media/video/stk-webcam.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c index 5fc6bbc165fa..cbc105f975de 100644 --- a/drivers/media/video/stk-webcam.c +++ b/drivers/media/video/stk-webcam.c | |||
@@ -55,6 +55,8 @@ MODULE_AUTHOR("Jaime Velasco Juan <jsagarribay@gmail.com> and Nicolas VIVIEN"); | |||
55 | MODULE_DESCRIPTION("Syntek DC1125 webcam driver"); | 55 | MODULE_DESCRIPTION("Syntek DC1125 webcam driver"); |
56 | 56 | ||
57 | 57 | ||
58 | /* bool for webcam LED management */ | ||
59 | int first_init = 1; | ||
58 | 60 | ||
59 | /* Some cameras have audio interfaces, we aren't interested in those */ | 61 | /* Some cameras have audio interfaces, we aren't interested in those */ |
60 | static struct usb_device_id stkwebcam_table[] = { | 62 | static struct usb_device_id stkwebcam_table[] = { |
@@ -560,6 +562,12 @@ static int v4l_stk_open(struct file *fp) | |||
560 | 562 | ||
561 | if (dev == NULL || !is_present(dev)) | 563 | if (dev == NULL || !is_present(dev)) |
562 | return -ENXIO; | 564 | return -ENXIO; |
565 | |||
566 | if (!first_init) | ||
567 | stk_camera_write_reg(dev, 0x0, 0x24); | ||
568 | else | ||
569 | first_init = 0; | ||
570 | |||
563 | fp->private_data = dev; | 571 | fp->private_data = dev; |
564 | usb_autopm_get_interface(dev->interface); | 572 | usb_autopm_get_interface(dev->interface); |
565 | 573 | ||
@@ -573,7 +581,7 @@ static int v4l_stk_release(struct file *fp) | |||
573 | if (dev->owner == fp) { | 581 | if (dev->owner == fp) { |
574 | stk_stop_stream(dev); | 582 | stk_stop_stream(dev); |
575 | stk_free_buffers(dev); | 583 | stk_free_buffers(dev); |
576 | stk_camera_write_reg(dev, 0x0, 0x48); /* turn off the LED */ | 584 | stk_camera_write_reg(dev, 0x0, 0x49); /* turn off the LED */ |
577 | unset_initialised(dev); | 585 | unset_initialised(dev); |
578 | dev->owner = NULL; | 586 | dev->owner = NULL; |
579 | } | 587 | } |
@@ -1350,6 +1358,7 @@ static int stk_camera_resume(struct usb_interface *intf) | |||
1350 | return 0; | 1358 | return 0; |
1351 | unset_initialised(dev); | 1359 | unset_initialised(dev); |
1352 | stk_initialise(dev); | 1360 | stk_initialise(dev); |
1361 | stk_camera_write_reg(dev, 0x0, 0x49); | ||
1353 | stk_setup_format(dev); | 1362 | stk_setup_format(dev); |
1354 | if (is_streaming(dev)) | 1363 | if (is_streaming(dev)) |
1355 | stk_start_stream(dev); | 1364 | stk_start_stream(dev); |