[media] drivers/media/video/stk-webcam.c: webcam LED bug fix
authorArvydas Sidorenko <asido4@gmail.com>
Tue, 13 Sep 2011 10:18:10 +0000 (07:18 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 18 Sep 2011 11:11:28 +0000 (08:11 -0300)
The probem was on my DC-1125 webcam chip from Syntek. Whenever the webcam turns
on, the LED light on it is turn on also and never turns off again unless system
is shut downed or restarted.

This patch will fix this issue - the LED will be turned off whenever the device
is released.

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/stk-webcam.c

index d1a2cefbf55bfffc14b4ba3dd33e4c87cccc6823..859e78fc1aa38ff4ab58eafe6578f51ad8153ae2 100644 (file)
@@ -574,6 +574,8 @@ 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 */
+               unset_initialised(dev);
                dev->owner = NULL;
        }