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: 2842 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sat, 27 Feb 2010 20:20:57 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Sat, 27 Feb 2010 17:22:04 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NlT9l-0002Qk-7F; Sat, 27 Feb 2010 20:20:57 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030783Ab0B0UUz (ORCPT + 1 other); 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 From: Max Thrun Set only the needed bits for AWB, and enable it by default. Signed-off-by: Max Thrun Signed-off-by: Antonio Ospite --- linux/drivers/media/video/gspca/ov534.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;