From patchwork Thu Nov 22 11:46:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jean-Francois Moine X-Patchwork-Id: 15560 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Tbbuv-0005uw-E8 for patchwork@linuxtv.org; Thu, 22 Nov 2012 19:54:29 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp for id 1Tbbuu-0007RH-G3; Thu, 22 Nov 2012 19:54:29 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753634Ab2KVSyS (ORCPT ); Thu, 22 Nov 2012 13:54:18 -0500 Received: from smtpfb2-g21.free.fr ([212.27.42.10]:47470 "EHLO smtpfb2-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641Ab2KVSxm convert rfc822-to-8bit (ORCPT ); Thu, 22 Nov 2012 13:53:42 -0500 Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [212.27.42.1]) by smtpfb2-g21.free.fr (Postfix) with ESMTP id 60178CA8F38 for ; Thu, 22 Nov 2012 12:47:16 +0100 (CET) Received: from armhf (unknown [IPv6:2a01:e35:2f5c:9de0:212:bfff:fe1e:9ce4]) by smtp1-g21.free.fr (Postfix) with ESMTP id 1240894017D; Thu, 22 Nov 2012 12:46:12 +0100 (CET) Date: Thu, 22 Nov 2012 12:46:52 +0100 From: Jean-Francois Moine To: Linux Media Mailing List , Hans de Goede Subject: [PATCH] gspca - ov534: Fix the light frequency filter Message-ID: <20121122124652.3a832e33@armhf> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; arm-unknown-linux-gnueabihf) Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.11.22.184823 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, MIME_LOWER_CASE 0.05, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1400_1499 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, CT_TEXT_PLAIN_UTF8_CAPS 0, INVALID_MSGID_NO_FQDN 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS ' (fix lack of signature) From: Jean-François Moine The exchanges relative to the light frequency filter were adapted from a description found in a ms-windows driver. It seems that the registers were the ones of some other sensor. This patch was done thanks to the documentation of the right OmniVision sensors. Note: The light frequency filter is either off or automatic. The application will see either off or "50Hz" only. Tested-by: alexander calderon Signed-off-by: Jean-François Moine --- a/drivers/media/usb/gspca/ov534.c +++ b/drivers/media/usb/gspca/ov534.c @@ -1038,13 +1038,12 @@ { struct sd *sd = (struct sd *) gspca_dev; - val = val ? 0x9e : 0x00; - if (sd->sensor == SENSOR_OV767x) { - sccb_reg_write(gspca_dev, 0x2a, 0x00); - if (val) - val = 0x9d; /* insert dummy to 25fps for 50Hz */ - } - sccb_reg_write(gspca_dev, 0x2b, val); + if (!val) + sccb_reg_write(gspca_dev, 0x13, /* off */ + sccb_reg_read(gspca_dev, 0x13) & ~0x20); + else + sccb_reg_write(gspca_dev, 0x13, /* auto */ + sccb_reg_read(gspca_dev, 0x13) | 0x20); }