From: johannes.goede@oss.qualcomm.com
To: Xiaolei Wang <xiaolei.wang@windriver.com>,
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, hverkuil-cisco@xs4all.nl,
jai.luthra@ideasonboard.com
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] media: i2c: ov5647: Convert to CCI register access helpers
Date: Mon, 29 Dec 2025 14:26:29 +0100 [thread overview]
Message-ID: <33e3e806-935f-4867-9a94-fa914d17a3ab@oss.qualcomm.com> (raw)
In-Reply-To: <20251229023018.2933405-2-xiaolei.wang@windriver.com>
Hi,
On 29-Dec-25 03:30, Xiaolei Wang wrote:
> Use the new common CCI register access helpers to replace the private
> register access helpers in the ov5647 driver. This simplifies the driver
> by reducing the amount of code.
Thank you for your patch, it is great to see more drivers
being converted to the CCI register access helpers.
> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> ---
...
> diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
> index e193fef4fced..fd69f1616794 100644
> --- a/drivers/media/i2c/ov5647.c
> +++ b/drivers/media/i2c/ov5647.c
...
> @@ -130,377 +122,377 @@ static const u8 ov5647_test_pattern_val[] = {
> 0x81, /* Random Data */
> };
>
> -static const struct regval_list sensor_oe_disable_regs[] = {
> - {0x3000, 0x00},
> - {0x3001, 0x00},
> - {0x3002, 0x00},
> +static const struct cci_reg_sequence sensor_oe_disable_regs[] = {
> + { CCI_REG8(0x3000), 0x00 },
> + { CCI_REG8(0x3001), 0x00 },
> + { CCI_REG8(0x3002), 0x00 },
> };
>
> -static const struct regval_list sensor_oe_enable_regs[] = {
> - {0x3000, 0x0f},
> - {0x3001, 0xff},
> - {0x3002, 0xe4},
> +static const struct cci_reg_sequence sensor_oe_enable_regs[] = {
> + { CCI_REG8(0x3000), 0x0f },
> + { CCI_REG8(0x3001), 0xff },
> + { CCI_REG8(0x3002), 0xe4 },
> };
For these 2, but also for the 2 much longer arrays with
address, value pairs which you are replacing, you are
replacing all the register addresses with CCI_REG8(0x3000).
Even though some of these are like 16 bit or even 24bit
registers, this in itself is not a problem.
But if you are replacing them 1:1 like this anyway then
IMHO it is better to just:
- Directly use struct reg_sequence instead of struct cci_reg_sequence
- Call regmap_multi_reg_write() instead of cci_multi_reg_write()
then you can keep all the initializer values for
the arrays the same (no need to add CCI_REG8() around
the addresses). This is also how this was done in other
drivers when they were converted to the CCI helpers.
This greatly reduces the size of the diff and makes it
much easier to review the patch.
Regards,
Hans
next prev parent reply other threads:[~2025-12-29 13:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-29 2:30 [PATCH v2 0/3] media: i2c: ov5647: Modernize driver with CCI and new stream APIs Xiaolei Wang
2025-12-29 2:30 ` [PATCH v2 1/3] media: i2c: ov5647: Convert to CCI register access helpers Xiaolei Wang
2025-12-29 12:37 ` Tarang Raval
2025-12-29 13:01 ` Laurent Pinchart
2025-12-29 13:26 ` Tarang Raval
2025-12-31 2:57 ` xiaolei wang
2025-12-29 13:26 ` johannes.goede [this message]
2025-12-29 14:52 ` Tarang Raval
2025-12-29 2:30 ` [PATCH v2 2/3] media: i2c: ov5647: Switch to using the sub-device state lock Xiaolei Wang
2025-12-29 18:55 ` Sakari Ailus
2025-12-31 2:58 ` xiaolei wang
2025-12-29 2:30 ` [PATCH v2 3/3] media: i2c: ov5647: switch to {enable,disable}_streams Xiaolei Wang
2025-12-29 13:43 ` Laurent Pinchart
2025-12-31 3:02 ` 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=33e3e806-935f-4867-9a94-fa914d17a3ab@oss.qualcomm.com \
--to=johannes.goede@oss.qualcomm.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=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=xiaolei.wang@windriver.com \
/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®