From patchwork Sat Feb 27 20:20:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 82726 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 o1RKVLKJ007926 for ; Sat, 27 Feb 2010 20:31:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030810Ab0B0UbT (ORCPT ); Sat, 27 Feb 2010 15:31:19 -0500 Received: from smtp-out116.alice.it ([85.37.17.116]:4844 "EHLO smtp-out116.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030801Ab0B0UbK (ORCPT ); Sat, 27 Feb 2010 15:31:10 -0500 Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out116.alice.it with Microsoft SMTPSVC(6.0.3790.3959); Sat, 27 Feb 2010 21:20:52 +0100 Received: from FBCMCL01B06.fbc.local ([192.168.69.87]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Sat, 27 Feb 2010 21:20:51 +0100 Received: from badebec ([82.61.82.143]) by FBCMCL01B06.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 1NlT9a-00024h-V0; Sat, 27 Feb 2010 21:20:46 +0100 From: Antonio Ospite To: linux-media@vger.kernel.org Cc: Antonio Ospite , Jean-Francois Moine , Max Thrun Subject: [PATCH 05/11] ov534: Fix setting manual exposure Date: Sat, 27 Feb 2010 21:20:22 +0100 Message-Id: <1267302028-7941-6-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:51.0517 (UTC) FILETIME=[5B4836D0: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:31:22 +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 @@ -59,7 +59,7 @@ u8 brightness; u8 contrast; u8 gain; - u8 exposure; + u16 exposure; u8 agc; u8 awb; u8 aec; @@ -140,7 +140,7 @@ .type = V4L2_CTRL_TYPE_INTEGER, .name = "Exposure", .minimum = 0, - .maximum = 255, + .maximum = 506, .step = 1, #define EXPO_DEF 120 .default_value = EXPO_DEF, @@ -684,11 +684,15 @@ static void setexposure(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; - u8 val; + u16 val; + + if (sd->aec) + return; val = sd->exposure; - sccb_reg_write(gspca_dev, 0x08, val >> 7); - sccb_reg_write(gspca_dev, 0x10, val << 1); + sccb_reg_write(gspca_dev, 0x08, val >> 8); + sccb_reg_write(gspca_dev, 0x10, val & 0xff); + } static void setagc(struct gspca_dev *gspca_dev)