mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/3] media: i2c: ov5647: Modernize driver with CCI and new stream APIs
@ 2025-12-31  8:39 Xiaolei Wang
  2025-12-31  8:39 ` [PATCH v3 1/3] media: i2c: ov5647: Convert to CCI register access helpers Xiaolei Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Xiaolei Wang @ 2025-12-31  8:39 UTC (permalink / raw)
  To: tarang.raval, laurent.pinchart, sakari.ailus, dave.stevenson,
	jacopo, mchehab, prabhakar.mahadev-lad.rj, hverkuil+cisco,
	johannes.goede, hverkuil-cisco, jai.luthra, xiaolei.wang
  Cc: linux-media, linux-kernel

This patch series modernizes the OV5647 camera sensor driver by:

1. Converting from private I2C register access functions to the common
   CCI (Camera Control Interface) register access helpers, which
   simplifies the code and provides better error handling.

2. Switching from driver-specific mutex to the sub-device state lock
   and properly implementing v4l2_subdev_init_finalize() lifecycle.

3. Converting from the legacy s_stream callback to the new
   enable_streams/disable_streams operations to align with current
   V4L2 subsystem standards.

I tested each patch on a Raspberry Pi 5 using the following commands:

rpicam-still --output test.jpg
rpicam-still -o long_exposure.jpg --shutter 100000000 --gain 1 --awbgains 1,1 --immediate

Changes in V3:

 - In patch 1, I replaced cci_multi_reg_write() with regmap_multi_reg_write() and
   fixed OV5647_REG_GAIN at 0x350a. I also replaced the original ret = PTR_ERR(sensor->regmap) with dev_err_probe().

 - In patch 2, I replaced the mutex with v4l2_subdev_lock_and_get_active_state() in s_stream().

 - In patch 3, I replaced err_rpm_put with done, and added the ov5647_stream_stop() function.

Changes in V2:
https://patchwork.kernel.org/project/linux-media/cover/20251229023018.2933405-1-xiaolei.wang@windriver.com/

 - Proper register width definitions
 - Fixed formatting and indentation
 - Error chaining implementation
 - Simplified chip detection logic
 - Clean compilation with -Werror
 - Add a new patch, switch from s_stream to enable_streams and disable_streams callbacks.

Link to V1: https://patchwork.kernel.org/project/linux-media/cover/20251226031311.2068414-1-xiaolei.wang@windriver.com/


Xiaolei Wang (3):
  media: i2c: ov5647: Convert to CCI register access helpers
  media: i2c: ov5647: Switch to using the sub-device state lock
  media: i2c: ov5647: switch to {enable,disable}_streams

 drivers/media/i2c/Kconfig  |   1 +
 drivers/media/i2c/ov5647.c | 389 +++++++++++++------------------------
 2 files changed, 140 insertions(+), 250 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-01-01  2:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-31  8:39 [PATCH v3 0/3] media: i2c: ov5647: Modernize driver with CCI and new stream APIs Xiaolei Wang
2025-12-31  8:39 ` [PATCH v3 1/3] media: i2c: ov5647: Convert to CCI register access helpers Xiaolei Wang
2025-12-31 10:26   ` Tarang Raval
2026-01-01  1:31     ` xiaolei wang
2025-12-31 12:12   ` johannes.goede
2025-12-31  8:39 ` [PATCH v3 2/3] media: i2c: ov5647: Switch to using the sub-device state lock Xiaolei Wang
2025-12-31 10:54   ` Tarang Raval
2026-01-01  2:03     ` xiaolei wang
2025-12-31  8:39 ` [PATCH v3 3/3] media: i2c: ov5647: switch to {enable,disable}_streams Xiaolei Wang
2025-12-31 11:03   ` Tarang Raval
2026-01-01  2:04     ` xiaolei wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®