From patchwork Thu Jul 15 10:17:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 12958 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id CC9C4C3225 for ; Thu, 15 Jul 2021 10:17:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 410B168523; Thu, 15 Jul 2021 12:17:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="R2Xshyvs"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 88E8C6059F for ; Thu, 15 Jul 2021 12:17:13 +0200 (CEST) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:fab7:64ae:4173:b5e8]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1A3C5340; Thu, 15 Jul 2021 12:17:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626344233; bh=23Yh9ml9d1VFFNgrH626hZq8vvYk/GZHE9S4PaVKJAw=; h=From:To:Cc:Subject:Date:From; b=R2XshyvsO/DVRG+rYYa9Y5W50kzZ73AbUcrqxGqLLF7jVMgXSAVh5ARjZH5qYtDJi 6g33k0/BovcuJ9fhazAkUu4aU5UVYk5zfVd6KzCoCv9nxSbmAAA4bgg2lpPPVlti43 +ogqQyeTthlKIo1OhhSdjBMzKbl0UgXkELGv4Rko= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Thu, 15 Jul 2021 12:17:09 +0200 Message-Id: <20210715101709.202034-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libipa: Correct OV5670 CameraSensorHelper gain values X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The datasheet states that the low 7 bits are fraction bits. real_gain = GainCode/128 For example, 0x080 is 1x gain, 0x100 is 2x gain. It means that we should have m0=1 and c1=128. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/ipa/libipa/camera_sensor_helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 17e4f0b2..709835a8 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -300,7 +300,7 @@ class CameraSensorHelperOv5670 : public CameraSensorHelper public: CameraSensorHelperOv5670() { - analogueGainConstants_ = { AnalogueGainLinear, 1, 0, 0, 256 }; + analogueGainConstants_ = { AnalogueGainLinear, 1, 0, 0, 128 }; } }; REGISTER_CAMERA_SENSOR_HELPER("ov5670", CameraSensorHelperOv5670)