[PATCH v5 00/15] media: i2c: os05b10: Refactor driver and Add new features
From: Tarang Raval
Date: Fri Oct 30 2026 - 06:50:43 EST
This series improves the OS05B10 sensor driver with cleanup,
refactoring, additional controls, and support for new modes.
Patches 1–4 are small, self-contained fixes and cleanups. Unused
group-hold programming is removed, the vmax variable used by the
VBLANK control is renamed to vts, the active format is updated before
adjusting framing controls, and runtime PM autosuspend is enabled.
Patches 5–7 refactor the driver. Register definitions are introduced,
the initialization tables are reorganized by splitting common and
mode-specific registers, and unused control fields are removed with
simplified error handling in control init.
Patches 8–10 add additional V4L2 controls including digital gain,
horizontal/vertical flip, and test pattern support.
Patches 11–12 extend the driver with 12-bit RAW support and add new
operating modes including 1080p and 2x2 binned 720p.
Patch 13 keeps the exposure range and default in sync with the active
mode on VBLANK and mode changes.
Patch 14 adds support for 2-lane MIPI CSI-2 operation.
Patch 15 fixes the horizontal blanking calculation and reports the
sensor's real internal pixel rate.
All patches were tested on the Debix Model A board running
Linux kernel v7.2.0-rc4.
Changelog:
v4 -> v5
- A few patches were mistakenly sent from an older version.
v3 -> v4
- Reorder the series: simple fixes first, then refactoring, then features.
- Drop v3 patch 1/17 (Use pm_runtime_get_if_active() when applying controls).
- Drop v3 patch 9/17: pixel rate does not depend on bpp.
- Patch 4/15: Call pm_runtime_dont_use_autosuspend() on probe error and remove.
- Patch 5/15: Add OS05B10_REG_PLL_CTRL(n); use named values in the init table.
- Patch 9/15: Chain cci_*() errors; update active format on flip change.
- Patch 11/15: os05b10_get_format_code() takes the mbus code instead of bpp.
- Patch 15/15: HTS counts 4 pixels; fixed 420 MPix/s pixel rate; add Fixes: tag.
- Collect Reviewed-by tags.
Link to v3: https://lore.kernel.org/linux-media/20260718200912.16001-1-tarang.raval@xxxxxxxxxxxxxxxxx/
v2 -> v3
- Patch 1/17: Drop Fixes:/Cc: stable tags; use "if (!pm_runtime_get_if_active(...))"
- Patch 3/17: Drop unused HDR define; use GAIN_DEFAULT macro;
DIGITAL_GAIN_STEP 16 -> 1 (tested, not in datasheet)
- Patch 4/17: Drop unrelated cosmetic reordering
- Patch 6/17: Use OS05B10_MIRROR/OS05B10_FLIP macros instead of GENMASK
- Patch 7/17: Clarify 0x5080 removal in commit msg; fix test_pattern_menu[]
casing
- Patch 8/17: Merge codes_12/codes_10 into one table; handle NULL mode list
- Add new Patch 16/17 & 17/17: Enable runtime PM autosuspend; remove unused
control fields/simplify
Link to v2: https://lore.kernel.org/linux-media/20260325114404.95188-1-tarang.raval@xxxxxxxxxxxxxxxxx/T/#t
v1 -> v2
- Added a separate patch to fix the use of pm_runtime_get_if_active().
- Modified patch 11 Remove unneccery exposure range update now just modifiyng one time only instead of twice.
- Add One patch for fix negative hblank calculation
Link to v1: https://lore.kernel.org/linux-media/20260306123304.76722-1-tarang.raval@xxxxxxxxxxxxxxxxx/T/#t
Tarang Raval (15):
media: i2c: os05b10: drop unused group-hold programming
media: i2c: os05b10: Rename vmax variable in VBLANK control
media: i2c: os05b10: Update active format before adjusting framing
controls
media: i2c: os05b10: Enable runtime PM autosuspend
media: i2c: os05b10: add register definitions and use them in init
table
media: i2c: os05b10: split common and mode-specific init registers
media: i2c: os05b10: remove unused control fields, simplify error
handling
media: i2c: os05b10: add V4L2 digital gain control
media: i2c: os05b10: Add H/V flip support
media: i2c: os05b10: Add test pattern options
media: i2c: os05b10: add 12-bit RAW mode support
media: i2c: os05b10: Add 1080p and 2x2 binning 720p modes
media: i2c: os05b10: keep exposure default in sync with the active
mode on VBLANK changes
media: i2c: os05b10: add 2-lane support
media: i2c: os05b10: fix horizontal blanking calculation
drivers/media/i2c/os05b10.c | 725 +++++++++++++++++++++++++++---------
1 file changed, 556 insertions(+), 169 deletions(-)
--
2.34.1