From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=168.119.41.54 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796200812; b=n7tf4X4FgcX6vzgbTwFYUQDvfw2BZZ+VQGby8E6NKycYhyQzwoHvOsHW7dvN0QBE7q8N cVT5CTWsgtLk2PbRC7RY4HHFAOgbpQnpHC1hxI71FEJkgqlyUj3KrAVdCO1thGHZkjjxo QpAR4nSIUkLkzUw/cw6IV6YKzE0a/8eNT8oZ5sqg7XtipqgIDfzEQ5pDESBQMQw5x+OWz x0W3MMVwlaN047g71YLOhNZHUG3kD86FpCeazS06wOWYeajc7b7yETaHKgAAmoj+dQDn7 Ut4YQneN4nlY0ZiJsLn8FMJeIJZYJwbAEQvh/fhGmNV36YF+Ai+b+51QdIa2uJw8jeQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796200812; h=DMARC-Filter:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id:References: In-Reply-To:To:Cc:X-Mailer:X-Spam-Score:X-Spam-Bar:X-Spam-Report; bh=C4RjsxDR3IvZoG/oPXme6PwDqdGhFgfQfvaYm2lyG4w=; b=XlNxp06UjRs8oPTHAFCpsQwKh4JURmfGkYFu0NZhX9uIDsI0CCKBW18JgCn/tfXy7HWi 2AHYy9LV1SO+PLctW+0haYY442Hx+6nSsWihlZKyQZJjl4psyLJDV82w3RnaIdcKlIYnS TP3Hil48SKaSby6gopSYux/bpTjiinyT/LfrjJ0IYcZIYdWlecn5J2Mi3IqNYd66yUyh7 Juan5Khpz7AQJ8d5MZyn7SbUVSqWPX4ij/E6vArgXE+mZHaUD2JaMm6RYMw9C7aFRsQ7i sPq84r0hBBYU8RKhsIT9bYM/5Xc52i7s5DkhpGaiMbkxcfN4dVf+L2TlEyimLozpwRQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=emfend.at; spf=pass smtp.mailfrom=emfend.at; dkim=pass header.d=emfend.at header.i=@emfend.at header.a=rsa-sha256 header.s=mail header.b=Id9B7g10; arc=none smtp.remote-ip=168.119.41.54 Received: from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6D1F606A322; Wed, 2 Dec 2026 08:40:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D6D1F606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=emfend.at Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=emfend.at Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=emfend.at header.i=@emfend.at header.a=rsa-sha256 header.s=mail header.b=Id9B7g10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at; s=mail; h=Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=C4RjsxDR3IvZoG/oPXme6PwDqdGhFgfQfvaYm2lyG4w=; b=Id9B7g106G1c7GdvbSf0AhsR20 6me848jRoJwibJtDj9Yi/NqN6BstX4/mgdike7vG+BiJCAWUB48x0lhJuLFZ1I61Gp4CNSiiWfVsg IbUhN0PFVVtfn5tfb1wWYBJ/oFhg01p3k+WSCrRs+lUZ8Cdo4s7F+PPFvKdCKOL8HwF0=; Received: from 194-208-226-106.tele.net ([194.208.226.106]:49300 helo=[127.0.1.1]) by lx20.hoststar.hosting with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1xYfsg-000vbM-H6; Wed, 02 Dec 2026 09:40:02 +0100 From: Matthias Fend Date: Wed, 02 Dec 2026 09:40:00 +0100 Subject: [PATCH 1/3] media: i2c: ov08d10: fix exposure X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261202-ov08d10-ctrl-fixes-v1-1-778dc83babdd@emfend.at> References: <20261202-ov08d10-ctrl-fixes-v1-0-778dc83babdd@emfend.at> In-Reply-To: <20261202-ov08d10-ctrl-fixes-v1-0-778dc83babdd@emfend.at> To: Sakari Ailus , Jimmy Su , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Matthias Fend X-Mailer: b4 0.14.2 X-Spam-Score: -1.0 X-Spam-Bar: - X-Spam-Report: Spam detection software, running on the system "lx20.hoststar.hosting", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Some fixes and adjustments for the OV08D10 sensor controls. The calculations used wrong formulas and constants, but happened to produce quite suitable results for some (standard) operating modes. This [...] Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address 0.0 KAM_DMARC_STATUS Test Rule for DKIM or SPF Failure with Strict Alignment (older systems) 0.0 Local_hs_NotFromHoststar Sender is NOT hoststar.(ch|at|com) 0.0 Local_hs_NotToHoststar Recipient is NOT hoststar.(ch|at|com) According to the datasheet, the exposure register is simply in units of half lines. The previous, more complex calculation was only approximately correct in the full resolution modes (+3.4%) and far off in the binning mode (-33%). Furthermore, the sensor prolongs the frame if the exposure reaches or exceeds VTS - 20 lines, so the previous margin of 6 lines allowed exposures that lowered the frame rate. Write 2 * exposure to the register and set the margin to 20 + 1 lines. Fixes: 7be91e02ed57 ("media: i2c: Add ov08d10 camera sensor driver") Signed-off-by: Matthias Fend --- drivers/media/i2c/ov08d10.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/media/i2c/ov08d10.c b/drivers/media/i2c/ov08d10.c index a83317da3d92dcb9693053cc6824bf43fd22308c..22eee655b52628f162810c1b38607b6b25e7f0e6 100644 --- a/drivers/media/i2c/ov08d10.c +++ b/drivers/media/i2c/ov08d10.c @@ -14,7 +14,6 @@ #include #define OV08D10_SCLK 144000000ULL -#define OV08D10_ROWCLK 36000 #define OV08D10_DATA_LANES 2 #define OV08D10_RGB_DEPTH 10 @@ -39,7 +38,7 @@ #define OV08D10_REG_EXPOSURE_M 0x03 #define OV08D10_REG_EXPOSURE_L 0x04 #define OV08D10_EXPOSURE_MIN 6 -#define OV08D10_EXPOSURE_MAX_MARGIN 6 +#define OV08D10_EXPOSURE_MAX_MARGIN (20 + 1) #define OV08D10_EXPOSURE_STEP 1 /* Analog gain controls from sensor */ @@ -796,20 +795,10 @@ static int ov08d10_set_exposure(struct ov08d10 *ov08d10, u32 exposure) { struct i2c_client *client = v4l2_get_subdevdata(&ov08d10->sd); u8 val; - u8 hts_h, hts_l; - u32 hts, cur_vts, exp_cal; int ret; - cur_vts = ov08d10_get_mode(ov08d10)->vts_def; - ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0x01); - if (ret < 0) - return ret; + exposure *= 2; - hts_h = i2c_smbus_read_byte_data(client, 0x37); - hts_l = i2c_smbus_read_byte_data(client, 0x38); - hts = ((hts_h << 8) | (hts_l)); - exp_cal = 66 * OV08D10_ROWCLK / hts; - exposure = exposure * exp_cal / (cur_vts - OV08D10_EXPOSURE_MAX_MARGIN); /* CIS control registers */ ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0x01); if (ret < 0) -- 2.34.1