This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] stk-webcam.c: webcam LED bug fix
Author:  Arvydas Sidorenko <[email protected]>
Date:    Wed Sep 21 10:58:31 2011 -0300

This is an improved version of the patch I sent a little ago.

The problem was:
        On my DC-1125 webcam chip from Syntek, whenever the webcam turns
        on, the LED light on it is turned on also and never turns off again 
unless
        system is shut downed or restarted.

The previous version seemed to break some other laptop webcam work. Thanks
to Andrea Anacleto for the bug report and solution.

Signed-off-by: Andrea Anacleto <[email protected]>
Signed-off-by: Arvydas Sidorenko <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/video/stk-webcam.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=7b1c8f58fcdbed75903943705ef41816e9648c1b

diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index 5fc6bbc..cbc105f 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -55,6 +55,8 @@ MODULE_AUTHOR("Jaime Velasco Juan <[email protected]> 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[] = {
@@ -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);
 
@@ -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;
        }
@@ -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);

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to