From patchwork Mon Mar 1 11:53:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 2866 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Mon, 01 Mar 2010 11:53:53 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Mon, 01 Mar 2010 10:30:18 -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 1Nm4C9-000160-1q; Mon, 01 Mar 2010 11:53:53 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751242Ab0CALxv (ORCPT + 1 other); Mon, 1 Mar 2010 06:53:51 -0500 Received: from smtp-out04.alice.it ([85.37.17.100]:1526 "EHLO smtp-out04.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751192Ab0CALxu (ORCPT ); Mon, 1 Mar 2010 06:53:50 -0500 Received: from FBCMMO03.fbc.local ([192.168.68.197]) by smtp-out04.alice.it with Microsoft SMTPSVC(6.0.3790.3959); Mon, 1 Mar 2010 12:53:48 +0100 Received: from FBCMCL01B08.fbc.local ([192.168.171.46]) by FBCMMO03.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Mon, 1 Mar 2010 12:53:48 +0100 Received: from badebec ([87.3.28.51]) by FBCMCL01B08.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Mon, 1 Mar 2010 12:53:47 +0100 Received: by badebec with local (Exim 4.71) (envelope-from ) id 1Nm4Bw-0007cC-2x; Mon, 01 Mar 2010 12:53:40 +0100 From: Antonio Ospite To: linux-media@vger.kernel.org Cc: Antonio Ospite , Jean-Francois Moine , Max Thrun Subject: [PATCH v2 05/11] ov534: Fix and document setting manual exposure Date: Mon, 1 Mar 2010 12:53:34 +0100 Message-Id: <1267444414-29248-1-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.7.0 In-Reply-To: <20100301121035.8677f284.ospite@studenti.unina.it> References: <20100301121035.8677f284.ospite@studenti.unina.it> X-OriginalArrivalTime: 01 Mar 2010 11:53:47.0984 (UTC) FILETIME=[DA44FD00:01CAB935] Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Document that even if the state is a u8 value, both MSB and LSB are set as sd->exposure represents half of the value we are going to set into registers. Skip setting exposure when AEC is enabled. Signed-off-by: Antonio Ospite --- The code was already doing the right thing, I just overlooked it. Regards, Antonio linux/drivers/media/video/gspca/ov534.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 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 @@ -686,6 +686,15 @@ struct sd *sd = (struct sd *) gspca_dev; u8 val; + if (sd->aec) + return; + + /* 'val' is one byte and represents half of the exposure value we are + * going to set into registers, a two bytes value: + * + * MSB: ((u16) val << 1) >> 8 == val >> 7 + * LSB: ((u16) val << 1) & 0xff == val << 1 + */ val = sd->exposure; sccb_reg_write(gspca_dev, 0x08, val >> 7); sccb_reg_write(gspca_dev, 0x10, val << 1);