From patchwork Sun May 30 22:25:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Lorin X-Patchwork-Id: 103172 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4UMPw5t014031 for ; Sun, 30 May 2010 22:25:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751421Ab0E3WZ5 (ORCPT ); Sun, 30 May 2010 18:25:57 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]:64087 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751266Ab0E3WZ4 (ORCPT ); Sun, 30 May 2010 18:25:56 -0400 Received: by wwb28 with SMTP id 28so913962wwb.19 for ; Sun, 30 May 2010 15:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=HfP7Lr8HtS4aW8OzJwQMkGF+2mz2YJaA9+/hhlNT1sc=; b=KD6JsJhLOxjZIQRLhHP0Pz5GNHVZC5Hh7StdnwWyC7WbEdb4ZpelftzazPmjMYqpXh G5fM3dT4QJqnovYzgjr3oCEPdry5hD28wddlCYwvHMVO4vAJVRSRxF/ljGwpEmlc9aya JJ1HDnq4z7L96ArXMBm+20OLy909As6ikoBx4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=KW2vcy00G6yfCjXSYif407BujV9RB6S8q9pz117FLm64LlG6quwsMC341FnriJMfq7 EuPeg+kV6qmagRH3OeNJdzlIhbN9YuQL+V7yMEc22eDl6S1wTbiMWR9yRtukparKv06l 3Xor3/7kSqf70K88QN298bRuD7tjJXGtHpqD0= Received: by 10.227.128.208 with SMTP id l16mr3410724wbs.175.1275258353896; Sun, 30 May 2010 15:25:53 -0700 (PDT) Received: from [192.168.1.4] (cha25-4-78-248-177-42.fbx.proxad.net [78.248.177.42]) by mx.google.com with ESMTPS id h22sm30037373wbh.21.2010.05.30.15.25.52 (version=SSLv3 cipher=RC4-MD5); Sun, 30 May 2010 15:25:53 -0700 (PDT) Subject: [PATCH 2/3] Gspca-gl860 - MI2030 sensor subdriver rewrite From: Olivier Lorin To: V4L Mailing List Cc: Jean-Francois Moine Date: Mon, 31 May 2010 00:25:50 +0200 Message-Id: <1275258350.18267.25.camel@miniol> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 30 May 2010 22:26:05 +0000 (UTC) diff -urpN der_gl860i1/gl860.c gl860/gl860.c --- der_gl860i1/gl860.c 2010-04-28 23:26:53.000000000 +0200 +++ gl860/gl860.c 2010-04-29 21:01:15.000000000 +0200 @@ -91,7 +91,6 @@ SD_SETGET(contrast) /* control table */ static struct ctrl sd_ctrls_mi1320[GL860_NCTRLS]; static struct ctrl sd_ctrls_mi2020[GL860_NCTRLS]; -static struct ctrl sd_ctrls_mi2020b[GL860_NCTRLS]; static struct ctrl sd_ctrls_ov2640[GL860_NCTRLS]; static struct ctrl sd_ctrls_ov9655[GL860_NCTRLS]; @@ -121,8 +120,6 @@ static int gl860_build_control_table(str sd_ctrls = sd_ctrls_mi1320; else if (_MI2020_) sd_ctrls = sd_ctrls_mi2020; - else if (_MI2020b_) - sd_ctrls = sd_ctrls_mi2020b; else if (_OV2640_) sd_ctrls = sd_ctrls_ov2640; else if (_OV9655_) @@ -187,19 +184,6 @@ static const struct sd_desc sd_desc_mi20 .dq_callback = sd_callback, }; -static const struct sd_desc sd_desc_mi2020b = { - .name = MODULE_NAME, - .ctrls = sd_ctrls_mi2020b, - .nctrls = GL860_NCTRLS, - .config = sd_config, - .init = sd_init, - .isoc_init = sd_isoc_init, - .start = sd_start, - .stop0 = sd_stop0, - .pkt_scan = sd_pkt_scan, - .dq_callback = sd_callback, -}; - static const struct sd_desc sd_desc_ov2640 = { .name = MODULE_NAME, .ctrls = sd_ctrls_ov2640, @@ -344,8 +328,6 @@ static int sd_config(struct gspca_dev *g sd->sensor = ID_OV9655; else if (strcmp(sensor, "MI2020") == 0) sd->sensor = ID_MI2020; - else if (strcmp(sensor, "MI2020b") == 0) - sd->sensor = ID_MI2020b; /* Get sensor and set the suitable init/start/../stop functions */ if (gl860_guess_sensor(gspca_dev, vendor_id, product_id) == -1) @@ -369,13 +351,6 @@ static int sd_config(struct gspca_dev *g dev_init_settings = mi2020_init_settings; break; - case ID_MI2020b: - gspca_dev->sd_desc = &sd_desc_mi2020b; - cam->cam_mode = mi2020_mode; - cam->nmodes = ARRAY_SIZE(mi2020_mode); - dev_init_settings = mi2020_init_settings; - break; - case ID_OV2640: gspca_dev->sd_desc = &sd_desc_ov2640; cam->cam_mode = ov2640_mode; @@ -620,7 +595,7 @@ int gl860_RTx(struct gspca_dev *gspca_de else if (len > 1 && r < len) PDEBUG(D_ERR, "short ctrl transfer %d/%d", r, len); - if ((_MI2020_ || _MI2020b_ || _MI2020c_) && (val || index)) + if (_MI2020_ && (val || index)) msleep(1); if (_OV2640_) msleep(1); @@ -767,8 +742,6 @@ static int gl860_guess_sensor(struct gsp PDEBUG(D_PROBE, "05e3:f191 sensor MI1320 (1.3M)"); } else if (_MI2020_) { PDEBUG(D_PROBE, "05e3:0503 sensor MI2020 (2.0M)"); - } else if (_MI2020b_) { - PDEBUG(D_PROBE, "05e3:0503 sensor MI2020 alt. driver (2.0M)"); } else if (_OV9655_) { PDEBUG(D_PROBE, "05e3:0503 sensor OV9655 (1.3M)"); } else if (_OV2640_) { diff -urpN der_gl860i1/gl860.h gl860/gl860.h --- der_gl860i1/gl860.h 2010-04-28 13:56:51.000000000 +0200 +++ gl860/gl860.h 2010-04-28 13:36:36.000000000 +0200 @@ -32,12 +32,9 @@ #define ID_OV2640 2 #define ID_OV9655 4 #define ID_MI2020 8 -#define ID_MI2020b 16 #define _MI1320_ (((struct sd *) gspca_dev)->sensor == ID_MI1320) #define _MI2020_ (((struct sd *) gspca_dev)->sensor == ID_MI2020) -#define _MI2020b_ (((struct sd *) gspca_dev)->sensor == ID_MI2020b) -#define _MI2020c_ 0 #define _OV2640_ (((struct sd *) gspca_dev)->sensor == ID_OV2640) #define _OV9655_ (((struct sd *) gspca_dev)->sensor == ID_OV9655) diff -urpN der_gl860i1/gl860-mi2020.c gl860/gl860-mi2020.c --- der_gl860i1/gl860-mi2020.c 2009-12-30 18:19:11.000000000 +0100 +++ gl860/gl860-mi2020.c 2010-05-30 23:41:56.000000000 +0200 @@ -1,6 +1,7 @@ /* Subdriver for the GL860 chip with the MI2020 sensor - * Author Olivier LORIN, from Ice/Soro2005's logs(A), Fret_saw/Hulkie's - * logs(B) and Tricid"s logs(C). With the help of Kytrix/BUGabundo/Blazercist. + * Author Olivier LORIN, from logs by Iceman/Soro2005 + Fret_saw/Hulkie/Tricid + * with the help of Kytrix/BUGabundo/Blazercist. + * Driver achieved thanks to a webcam gift by Kytrix. *