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: 2849 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sat, 27 Feb 2010 20:31:21 +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:31:24 -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 1NlTJp-0004Om-8J; Sat, 27 Feb 2010 20:31:21 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030810Ab0B0UbT (ORCPT + 1 other); 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 Exposure is now a u16 value, both MSB and LSB are set, but values in the v4l2 control are limited to the interval [0,506] as 0x01fa (506) is the maximum observed value with AEC enabled. Skip setting exposure when AEC is enabled. Signed-off-by: Antonio Ospite --- linux/drivers/media/video/gspca/ov534.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 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 @@ -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)