[PATCH] UBUNTU: [Jaunty SRU] LP#310760 Fix the MIC of the Lenovo webcam problem

AceLan Kao acelan.kao at canonical.com
Fri Jul 31 06:15:46 UTC 2009


BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/310760

SRU JUSTIFICATION

IMPACT: The MIC of the Lenovo webcam doesn't work after launching the
camera, because of the i2c command that turn on/off the LED for the
camera is wrong and will impact the MIC function.

FIX: By snooping the USB traffic from Windows and extracting the correct
i2c commands that turn on/off the LED. The patch goes to the V4L/DVB tree
contains other bug fixes that introduced from the following two 2.6.29
commits
6af4e7a V4L/DVB (10424): gspca - vc032x: Add resolution 1280x1024 for
sensor mi1310_soc.
a92e906 V4L/DVB (10420): gspca - vc032x: Webcam 041e:405b added and
mi1310_soc updated.
I only merge back the LED part, since Jaunty doesn't have that problem.
The patch is already accepted by the V4L/DVB branch and will be merged
into upstream kernel later.
http://linuxtv.org/hg/v4l-dvb/rev/49966c5f2052

TEST: This patch work fine with the Lenovo webcam I have.

git://kernel.ubuntu.com/acelan/ubuntu-jaunty.git lp310760

Signed-off-by: AceLan Kao <acelan.kao at canonical.com>
---
 drivers/media/video/gspca/vc032x.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c
index 17af353..f751f21 100644
--- a/drivers/media/video/gspca/vc032x.c
+++ b/drivers/media/video/gspca/vc032x.c
@@ -1559,6 +1559,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
 			/* 640x480 */
 			usb_exchange(gspca_dev, mi1310_socinitVGA_JPG);
 		}
+		// turn on LED
+		reg_w(gspca_dev->dev, 0x89, 0x058c, 0x0000);
 		break;
 	case SENSOR_MI1320:
 		GammaT = mi1320_gamma;
@@ -1627,8 +1629,12 @@ static int sd_start(struct gspca_dev *gspca_dev)
 static void sd_stopN(struct gspca_dev *gspca_dev)
 {
 	struct usb_device *dev = gspca_dev->dev;
+	struct sd *sd = (struct sd *) gspca_dev;
 
-	reg_w(dev, 0x89, 0xffff, 0xffff);
+	if( sd->sensor == SENSOR_MI1310_SOC)
+		reg_w(dev, 0x89, 0x058c, 0x00ff);
+	else
+		reg_w(dev, 0x89, 0xffff, 0xffff);
 	reg_w(dev, 0xa0, 0x01, 0xb301);
 	reg_w(dev, 0xa0, 0x09, 0xb003);
 }
@@ -1637,10 +1643,14 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
 static void sd_stop0(struct gspca_dev *gspca_dev)
 {
 	struct usb_device *dev = gspca_dev->dev;
+	struct sd *sd = (struct sd *) gspca_dev;
 
 	if (!gspca_dev->present)
 		return;
-	reg_w(dev, 0x89, 0xffff, 0xffff);
+	if( sd->sensor == SENSOR_MI1310_SOC)
+		reg_w(dev, 0x89, 0x058c, 0x00ff);
+	else
+		reg_w(dev, 0x89, 0xffff, 0xffff);
 }
 
 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
-- 
1.6.0.4





More information about the kernel-team mailing list