From patchwork Sat Feb 27 20:20:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 82718 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 o1RKKv5W005440 for ; Sat, 27 Feb 2010 20:20:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030783Ab0B0UUz (ORCPT ); Sat, 27 Feb 2010 15:20:55 -0500 Received: from smtp-OUT05A.alice.it ([85.33.3.5]:2350 "EHLO smtp-OUT05A.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030778Ab0B0UUy (ORCPT ); Sat, 27 Feb 2010 15:20:54 -0500 Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-OUT05A.alice.it with Microsoft SMTPSVC(6.0.3790.3959); Sat, 27 Feb 2010 21:20:52 +0100 Received: from FBCMCL01B04.fbc.local ([192.168.69.85]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Sat, 27 Feb 2010 21:20:52 +0100 Received: from badebec ([82.61.82.143]) by FBCMCL01B04.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Sat, 27 Feb 2010 21:20:51 +0100 Received: by badebec with local (Exim 4.71) (envelope-from ) id 1NlT9b-00024j-1h; Sat, 27 Feb 2010 21:20:47 +0100 From: Antonio Ospite To: linux-media@vger.kernel.org Cc: Max Thrun , Jean-Francois Moine , Antonio Ospite Subject: [PATCH 06/11] ov534: Fix Auto White Balance control Date: Sat, 27 Feb 2010 21:20:23 +0100 Message-Id: <1267302028-7941-7-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.7.0 In-Reply-To: <1267302028-7941-1-git-send-email-ospite@studenti.unina.it> References: <1267302028-7941-1-git-send-email-ospite@studenti.unina.it> X-OriginalArrivalTime: 27 Feb 2010 20:20:52.0850 (UTC) FILETIME=[5C139D20:01CAB7EA] 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]); Sat, 27 Feb 2010 20:20:58 +0000 (UTC) Index: gspca/linux/drivers/media/video/gspca/ov534.c =================================================================== --- gspca.orig/linux/drivers/media/video/gspca/ov534.c +++ gspca/linux/drivers/media/video/gspca/ov534.c @@ -171,7 +171,7 @@ .minimum = 0, .maximum = 1, .step = 1, -#define AWB_DEF 0 +#define AWB_DEF 1 .default_value = AWB_DEF, }, .set = sd_setawb, @@ -718,10 +718,17 @@ { struct sd *sd = (struct sd *) gspca_dev; - if (sd->awb) - sccb_reg_write(gspca_dev, 0x63, 0xe0); /* AWB on */ - else - sccb_reg_write(gspca_dev, 0x63, 0xaa); /* AWB off */ + if (sd->awb) { + sccb_reg_write(gspca_dev, 0x13, + sccb_reg_read(gspca_dev, 0x13) | 0x02); + sccb_reg_write(gspca_dev, 0x63, + sccb_reg_read(gspca_dev, 0x63) | 0xc0); + } else { + sccb_reg_write(gspca_dev, 0x13, + sccb_reg_read(gspca_dev, 0x13) & ~0x02); + sccb_reg_write(gspca_dev, 0x63, + sccb_reg_read(gspca_dev, 0x63) & ~0xc0); + } } static void setaec(struct gspca_dev *gspca_dev) @@ -800,9 +807,7 @@ #else gspca_dev->ctrl_inac |= (1 << AWB_IDX); #endif -#if AWB_DEF != 0 - sd->awb = AWB_DEF -#endif + sd->awb = AWB_DEF; sd->aec = AEC_DEF; #if SHARPNESS_DEF != 0 sd->sharpness = SHARPNESS_DEF;