From patchwork Wed Aug 26 08:23:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UsOzYmVydCBCb8W+aWs=?= X-Patchwork-Id: 28098 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 1E877C333C for ; Wed, 26 Aug 2026 08:33:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A932E6843C; Wed, 26 Aug 2026 10:33:25 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lxMrnVFd"; dkim-atps=neutral Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 641FB68406 for ; Wed, 26 Aug 2026 10:23:34 +0200 (CEST) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-c15d3cd51b2so89659266b.3 for ; Wed, 26 Aug 2026 01:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787732614; x=1788337414; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=YZkELr7iCSTgCCm9hYmaXDbC+1QVtiW84rLB7w3K9ZE=; b=lxMrnVFdOufVgYrAsHOdDNY4FrYmcup/S1ukanmVfngvl9roA/Vk9hA1zx+kt7z7XS acLIiC+lfpHrgdjyU/z3eT6tVY4YROeQuQzYmJH6EqbIT3TTYOYSQOhVS78KeuXPrjr+ nfto4RobXFFrVQalnQ4+0amAdsWd0TETwc2rVdDcGWMQW3QBccSQ7C21Evi8zC9Pr4Ok TRjmsWlWYogFuwyTjbHyTquGpu8GEpk9vck8Txs5tCfbW+QfjJc9FmAneLEqt7W6VuRE /mUbZaEAfqE0ekKaUPDVvTman59IlyugqGrRBbvjXxtYJ+p82RZFagsKtljlQmH+i7Np CyJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787732614; x=1788337414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=YZkELr7iCSTgCCm9hYmaXDbC+1QVtiW84rLB7w3K9ZE=; b=XilmVYeH07WQ/cZVys5yBCWAt/luIFDw5VV1zduebbKv+US+LXG8HbFad8laaEfz6a LJue64fMyL+0ndQ408EoczcGur/DnpNYZdtq9La4jW44Y3a6ogd7SLWbbxaWpm8+S+aL ZftIM7rfkU8s+gRZP1upgmEQN35Qfs33w3lYNWT0PrA+Lxw3MDfw2oGvGC4qZ5UC6Mtc bo7d9xne3awGeFl+aXeWbQzyC9YFcH3ZH/uecNEYP2uoJPglasVByXhNsvFWZ3MZe1hA 05Tms+thmMmXtfwIKiW7n1pY9fmW/AIlTU/sF186JTei5noB90lE/QAUROaYOdYBMHyR MVOQ== X-Gm-Message-State: AFuF++lSks4B2cYMRVEIiZwEOxkOX0uZnPo68U+a+JVVzYfieWefL4ju 905/aRua1h9bC8QnDphuq7aIUM9RUKCMZj7L5n7+fuERbqHzEoNlio4w68VOWmFfFow= X-Gm-Gg: AR+sD10KpQl46o6SBEJKqU0/Y0+2gW66wmnf6JIX3Tphi50ErDgH2q5cY94TTsEoWtO SNAhTiMJ68LM09JrVZRX3w4drHXnrO8bnPW9m1esqtOBKIajopic4l45UoupvCmsk88sfDW/2bt C2dnCiCCra4juH1fyPAufs+XP579aROktggFsqKMkOvxEIHqu+1k+aHxX4AX3I80Wne4wtnahfh inPEi6Ta1qA3wnzHYGBc+12EDIUfMqDiXlMC5Hl11sCkfm5SIHVk4YeLClLpnvJoo8/TCq4/GKx 0m6bRzErlwtxj39Y7sobCxAkLQT6rrdqiHNafvDJStYd6zseorPYOXs0hTJ4lRERoVI1NjkhOPJ yo4D/YCOw15K3yHdRFmfQPcDjOmbt3X5WjRw/XCqUfMBoAxx7knEoEa8NWyl7OG/tGtzxFMD9Q2 x1l5D87GHCtkOSAPFLhe4TGMMUzw+vdpobmrUmZq8DZs+Jb/UK4niLcwOb5vBnbciOOnodUVG4M NAjZ6MXO2f4Lwhpj+iMtl/mIEpHjM5WfpH/AQop45NyoM67NBL84IZM6lnZeGLhP8Bs50KB08rj 06TVhZ+yKjiRXr0= X-Received: by 2002:a17:907:97d5:b0:c16:14d1:b529 with SMTP id a640c23a62f3a-c250c36ae0bmr570300266b.18.1787732613648; Wed, 26 Aug 2026 01:23:33 -0700 (PDT) Received: from robert-83cx (static-dsl-191.87-197-115.telecom.sk. [87.197.115.191]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c250a5d69a7sm554222766b.8.2026.08.26.01.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2026 01:23:33 -0700 (PDT) From: Robert Bozik To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham , Milan Zamazal , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Hans de Goede , Robert Mader , Bryan O'Donoghue , Laurent Pinchart , Robert Bozik Subject: [PATCH 2/7] ipa: libipa: camera_sensor_helper: Add OV32C4 Date: Wed, 26 Aug 2026 10:23:23 +0200 Message-ID: <20260826082328.24176-3-robertbozik@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260826082328.24176-1-robertbozik@gmail.com> References: <20260826082328.24176-1-robertbozik@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 26 Aug 2026 10:33:21 +0200 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" Both numbers were measured on the sensor rather than taken from the OmniVision helpers already present, because the obvious donor is wrong for this part. The analogue gain is linear in the register value, but unity is at 0x100, not at 0x80 as on ov13b10 and ov08x40 which use the same register: below 0x100 the output stops tracking the value written at all, and the chip itself powers up at 0x100. Using code/128 here would make the AE loop believe it has twice the gain it actually applied. The black level is 0x40 at 10 bits, measured with the sensor covered across the whole gain range, where it stays within one LSB. Signed-off-by: Robert Bozik --- src/ipa/libipa/camera_sensor_helper.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 82bf255d..6b746727 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -763,6 +763,23 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER("ov2740", CameraSensorHelperOv2740) +class CameraSensorHelperOv32c4 : public CameraSensorHelper +{ +public: + CameraSensorHelperOv32c4() + { + /* + * Measured on the sensor: the black level is 0x40 at 10 bits, + * and the gain is linear in the register value with unity at + * 0x100, not at 0x80 as on other OmniVision sensors sharing + * the same gain register. + */ + blackLevel_ = 4096; + gain_ = AnalogueGainLinear{ 1, 0, 0, 256 }; + } +}; +REGISTER_CAMERA_SENSOR_HELPER("ov32c4", CameraSensorHelperOv32c4) + class CameraSensorHelperOv4689 : public CameraSensorHelper { public: