From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Leitner Subject: [PATCH v3 0/8] media: i2c: ov9282: fix strobe timing and control handling Date: Tue, 10 Nov 2026 14:10:09 +0100 Message-Id: <20261110-ov9282-fixes-v3-0-cb6df80cbc22@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/2WNQQ7CIBBFr9KwFgODrcWV9zAuoAwWY1oDLalpe nehGqNx+TL/vZlJQO8wkEMxE4/RBdd3CcSmIE2rugtSZxITYFAxySTto4QaqHUTBmqUrCujdAO iJkm5e1wPyTidXxxGfcVmyI28aF0Yev9Y/0Wed+803/2mI6eM2hKYsqU0luvjzXXjtDUYSU5H+ Mic/cmQZKG12Fem1lzJb3lZliexsXmD9wAAAA== X-Change-ID: 20260909-ov9282-fixes-da986dabc238 To: Sakari Ailus , Dave Stevenson , Mauro Carvalho Chehab , Daniele Alessandrelli , "Paul J. Murphy" , Martina Krasteva , Richard Leitner , Hans Verkuil , Bryan O'Donoghue , Jacopo Mondi Cc: Mauro Carvalho Chehab , Gyula Kelemen , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794316220; l=3822; i=richard.leitner@linux.dev; s=20250225; h=from:subject:message-id; bh=+e5OdsGJqLLD8RjhIkfi2sD+B0gtjHN2GH3eK5G8NuU=; b=EZomxBc0VN1D4myCyqFdKxU5EedMoJuBgaxKUFFqM+rldOug6TP0yYA9yO8vA2eKnF+uNdp7f ZHymsBHwAIxBe7oMgla5VB592Y8n6p+DespbFSAEzxbAvOgXGtfbTF+ X-Developer-Key: i=richard.leitner@linux.dev; a=ed25519; pk=8hZNyyyQFqZ5ruVJsSGBSPIrmJpfDm5HwHU4QVOP1Pk= X-Endpoint-Received: by B4 Relay for richard.leitner@linux.dev/20250225 with auth_id=350 List-Id: B4 Relay Submissions This series fixes a set of related issues in the OV9282 strobe timing and control handling code. The driver updated exposure- and flash duration-related control ranges in several places, but some of those updates used an incorrect timebase or were triggered too late, which could leave the controls clamped against stale values. The series: - checks the return value of the exposure range update - drops the redundant vblank field - converts probe error messages to dev_err_probe() - fixes the 8-bit pixel rate (192 MHz instead of 200 MHz) and the corresponding line time calculation - treats the strobe frame span as a line count and converts the flash duration accordingly - fixes the flash duration range (min/max/default) and refreshes it on HBLANK changes, independent of the sensor power state - refreshes the exposure and flash duration ranges on mode changes - reprograms the strobe span when HBLANK changes This series was tested with an ov9282 sensor on a vision components camera module attached to an i.MX8MP mainboard in a defined (dark) environment with a custom made LED flash pcb. Any feedback is warmly welcome. Thanks! --- Changes in v3: - Adapt commit texts for 4/8 and 5/8 - Thanks to Dave the review! - Link to v2: https://patch.msgid.link/20261014-ov9282-fixes-v2-0-3bb376d8b1a9@linux.dev Changes in v2: - New patch: fix the 8-bit pixel rate. - New patch: re-write strobe span and HTS in s_ctrl when HBLANK changes - Calculate line time in ns using 64-bit math instead of 32-bit µs - Treat the strobe frame span as a line count and reuse the helpers of the exposure -> drop OV9282_STROBE_SPAN_FACTOR - Flash duration range: min is 1 line, max is S32_MAX instead of the current exposure time, default is converted from the register default - Refresh the flash duration range on HBLANK changes instead of on exposure/gain writes, so it is also correct while the sensor is idle - Add missing "\n" to dev_err_probe() messages - Add Fixes: and Cc: stable tags where applicable - Reorder patches to keep non-fixes at the end - Reword commit messages and subjects - Thanks to Dave, Bryan and Sakari for the review! - Link to v1: https://patch.msgid.link/20260914-ov9282-fixes-v1-0-f520af59df1b@linux.dev To: Sakari Ailus To: Dave Stevenson To: Mauro Carvalho Chehab To: Daniele Alessandrelli To: Paul J. Murphy To: Martina Krasteva To: Richard Leitner To: Hans Verkuil To: Bryan O'Donoghue To: Jacopo Mondi Cc: Mauro Carvalho Chehab Cc: Gyula Kelemen Cc: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- Richard Leitner (8): media: i2c: ov9282: handle error from exposure range update media: i2c: ov9282: fix pixel rate and line time calculation media: i2c: ov9282: fix flash duration to/from microseconds conversion media: i2c: ov9282: fix flash duration range calculation media: i2c: ov9282: add refresh of additional ranges on a mode change media: i2c: ov9282: recalculate strobe span on HBLANK change media: i2c: ov9282: drop redundant vblank field media: i2c: ov9282: harmonize dev_err_probe usage drivers/media/i2c/ov9282.c | 236 +++++++++++++++++++++++++++------------------ 1 file changed, 144 insertions(+), 92 deletions(-) --- base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb change-id: 20260909-ov9282-fixes-da986dabc238 Best regards, -- Richard Leitner