From: Xiaolei Wang <xiaolei.wang@windriver.com>
To: tarang.raval@siliconsignals.io,
laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com,
dave.stevenson@raspberrypi.com, jacopo@jmondi.org,
mchehab@kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com,
hverkuil+cisco@kernel.org, johannes.goede@oss.qualcomm.com,
hverkuil-cisco@xs4all.nl, jai.luthra@ideasonboard.com,
Xiaolei.Wang@windriver.com
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v4 0/3] media: i2c: ov5647: Modernize driver with CCI and new stream APIs
Date: Thu, 1 Jan 2026 18:29:58 +0800 [thread overview]
Message-ID: <20260101103001.207194-1-xiaolei.wang@windriver.com> (raw)
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-jpeg --output test.jpg
rpicam-still -o long_exposure.jpg --shutter 100000000 --gain 1 --awbgains 1,1 --immediate
Changes in V4:
- In patch 1, have corrected the issue of variables that do not need initialization.
I have defined a chip ID, dropped all control functions, and now set the
chip ID directly in the set control, using `cci_update_bits()` instead of
read + write operations.
- In patch 2, Use dev_err_probe instead of dev_err
- In patch 3, have corrected the issue of variables that do not need initialization.
Changes in V3:
https://patchwork.kernel.org/project/linux-media/cover/20251231083924.2657165-1-xiaolei.wang@windriver.com/
- 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 | 450 ++++++++++++-------------------------
2 files changed, 144 insertions(+), 307 deletions(-)
--
2.43.0
next reply other threads:[~2026-01-01 10:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-01 10:29 Xiaolei Wang [this message]
2026-01-01 10:29 ` [PATCH v4 1/3] media: i2c: ov5647: Convert to CCI register access helpers Xiaolei Wang
2026-01-01 11:15 ` johannes.goede
2026-01-01 11:15 ` johannes.goede
2026-01-01 10:30 ` [PATCH v4 2/3] media: i2c: ov5647: Switch to using the sub-device state lock Xiaolei Wang
2026-01-07 22:38 ` Sakari Ailus
2026-01-08 0:51 ` xiaolei wang
2026-01-01 10:30 ` [PATCH v4 3/3] media: i2c: ov5647: switch to {enable,disable}_streams Xiaolei Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260101103001.207194-1-xiaolei.wang@windriver.com \
--to=xiaolei.wang@windriver.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=hverkuil+cisco@kernel.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jacopo@jmondi.org \
--cc=jai.luthra@ideasonboard.com \
--cc=johannes.goede@oss.qualcomm.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=sakari.ailus@linux.intel.com \
--cc=tarang.raval@siliconsignals.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®