From patchwork Tue Feb 26 18:32:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Beno=C3=AEt_Th=C3=A9baudeau?= X-Patchwork-Id: 16980 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UAPSI-0002bq-3d; Tue, 26 Feb 2013 19:40:46 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp id 1UAPSH-00075X-Ah; Tue, 26 Feb 2013 19:40:45 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759754Ab3BZSkn (ORCPT + 1 other); Tue, 26 Feb 2013 13:40:43 -0500 Received: from zose-mta11.web4all.fr ([178.33.204.87]:33360 "EHLO zose-mta11.web4all.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759696Ab3BZSkm convert rfc822-to-8bit (ORCPT ); Tue, 26 Feb 2013 13:40:42 -0500 X-Greylist: delayed 433 seconds by postgrey-1.27 at vger.kernel.org; Tue, 26 Feb 2013 13:40:42 EST Received: from localhost (localhost [127.0.0.1]) by zose-mta11.web4all.fr (Postfix) with ESMTP id ADC292A005; Tue, 26 Feb 2013 19:33:28 +0100 (CET) X-Virus-Scanned: amavisd-new at zose-mta11.web4all.fr Received: from zose-mta11.web4all.fr ([127.0.0.1]) by localhost (zose-mta11.web4all.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04txAPtdtGYu; Tue, 26 Feb 2013 19:33:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zose-mta11.web4all.fr (Postfix) with ESMTP id 6CBA02A007; Tue, 26 Feb 2013 19:33:28 +0100 (CET) X-Virus-Scanned: amavisd-new at zose-mta11.web4all.fr Received: from zose-mta11.web4all.fr ([127.0.0.1]) by localhost (zose-mta11.web4all.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Ekylal90RZJm; Tue, 26 Feb 2013 19:33:27 +0100 (CET) Received: from advdt005-ubuntu.?none? (cie44-1-88-188-188-98.fbx.proxad.net [88.188.188.98]) by zose-mta11.web4all.fr (Postfix) with ESMTPA id 7E6642A001; Tue, 26 Feb 2013 19:33:27 +0100 (CET) From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Cc: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= , Guennadi Liakhovetski , =?UTF-8?q?Micka=C3=ABl=20Guivarc=27h?= , Subject: [PATCH] soc-camera: mt9m111: Fix auto-exposure control Date: Tue, 26 Feb 2013 19:32:49 +0100 Message-Id: <1361903569-30244-1-git-send-email-benoit.thebaudeau@advansee.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.2.26.183019 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1800_1899 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, CT_TEXT_PLAIN_UTF8_CAPS 0, TO_UNDISCLOSED_RECIPIENTS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __PHISH_SPEAR_STRUCTURE_1 0, __PHISH_SPEAR_STRUCTURE_2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_3 0, __URI_NO_WWW 0, __URI_NS ' Commit f9bd5843658e18a7097fc7258c60fb840109eaa8 changed V4L2_CID_EXPOSURE_AUTO from boolean to enum, and commit af8425c54beb3c32cbb503a379132b3975535289 changed the creation of this control into a menu for the mt9m111. However, mt9m111_set_autoexposure() is still interpreting the value set for this control as a boolean, which also conflicts with the default value of this control set to V4L2_EXPOSURE_AUTO (0). This patch makes mt9m111_set_autoexposure() interpret the value set for V4L2_CID_EXPOSURE_AUTO as defined by enum v4l2_exposure_auto_type. Cc: Guennadi Liakhovetski Cc: Mickaël Guivarc'h Cc: Signed-off-by: Benoît Thébaudeau Tested-By: Javier Martin --- drivers/media/i2c/soc_camera/mt9m111.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/soc_camera/mt9m111.c b/drivers/media/i2c/soc_camera/mt9m111.c index bbc4ff9..0b0ebaa 100644 --- a/drivers/media/i2c/soc_camera/mt9m111.c +++ b/drivers/media/i2c/soc_camera/mt9m111.c @@ -701,11 +701,11 @@ static int mt9m111_set_global_gain(struct mt9m111 *mt9m111, int gain) return reg_write(GLOBAL_GAIN, val); } -static int mt9m111_set_autoexposure(struct mt9m111 *mt9m111, int on) +static int mt9m111_set_autoexposure(struct mt9m111 *mt9m111, int val) { struct i2c_client *client = v4l2_get_subdevdata(&mt9m111->subdev); - if (on) + if (val == V4L2_EXPOSURE_AUTO) return reg_set(OPER_MODE_CTRL, MT9M111_OPMODE_AUTOEXPO_EN); return reg_clear(OPER_MODE_CTRL, MT9M111_OPMODE_AUTOEXPO_EN); }