From: Frank Li <Frank.li@nxp.com>
To: Michael Riesch <michael.riesch@collabora.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Maxime Ripard <mripard@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
imx@lists.linux.dev
Subject: Re: [PATCH 0/3] media: v4l: async: add helper API v4l2_async_pad_init_and_register_subdev()
Date: Fri, 20 Feb 2026 10:46:10 -0500 [thread overview]
Message-ID: <aZiBwmPos318nW9g@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <fb697f64-1f2f-4a9b-b430-23867f205f12@collabora.com>
On Fri, Feb 20, 2026 at 10:01:01AM +0100, Michael Riesch wrote:
> Hi Frank,
>
> Thanks for your patches.
>
> On 2/10/26 22:42, Frank Li wrote:
> > Add the helper API v4l2_async_pad_init_and_register_subdev(), which
> > combines media_entity_pads_init(), v4l2_subdev_init_finalize(), and
> > v4l2_async_register_subdev() into a single call.
>
> I think this is a good idea, but can you extend that to offer variants
> for v4l2_async_register_subdev_sensor and v4l2_device_register_subdev too?
>
> The function names are awfully long, though. Can we call this
> media_register_subdev{_async,_sensor,}
> maybe?
How about media_async_register_subdev()? which basic align other API
naming. I want to add more helper APIs.
drivers/media/platform/synopsys/dw-mipi-csi2rx.c have about 600 lines code
but related hardware register codes are below 20 line, only few registers.
I just post this simple version to gather feedback from maintainers and
reviewers on the overall approach.
Frank
>
> Best regards,
> Michael
>
> >
> > Reduce code duplication and simplify error handling in drivers.
> >
> > Only change dwc and cdns. If agree add API, more driver can be simplified.
> >
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> > Frank Li (3):
> > media: v4l: async: add helper API v4l2_async_pad_init_and_register_subdev()
> > media: synopsys: Use v4l2_async_pad_init_and_register_subdev() to simplify code
> > media: cadence: cdns-csi2rx: Use v4l2_async_pad_init_and_register_subdev() to simplify code
> >
> > drivers/media/platform/cadence/cdns-csi2rx.c | 18 ++++----------
> > drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 15 +++---------
> > drivers/media/v4l2-core/v4l2-async.c | 30 ++++++++++++++++++++++++
> > include/media/v4l2-async.h | 18 ++++++++++++++
> > 4 files changed, 55 insertions(+), 26 deletions(-)
> > ---
> > base-commit: bc0bfce7d0f8204e0bbadcee72e87ad9ec105c73
> > change-id: 20260210-v4l2_init_register-0e6d0adcfa21
> >
> > Best regards,
> > --
> > Frank Li <Frank.Li@nxp.com>
> >
>
next prev parent reply other threads:[~2026-02-20 15:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 21:42 Frank Li
2026-02-10 21:42 ` [PATCH 1/3] " Frank Li
2026-02-10 21:42 ` [PATCH 2/3] media: synopsys: Use v4l2_async_pad_init_and_register_subdev() to simplify code Frank Li
2026-02-10 21:42 ` [PATCH 3/3] media: cadence: cdns-csi2rx: " Frank Li
2026-02-20 9:01 ` [PATCH 0/3] media: v4l: async: add helper API v4l2_async_pad_init_and_register_subdev() Michael Riesch
2026-02-20 15:46 ` Frank Li [this message]
2026-02-23 8:34 ` Michael Riesch
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=aZiBwmPos318nW9g@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=imx@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=michael.riesch@collabora.com \
--cc=mripard@kernel.org \
--cc=sakari.ailus@linux.intel.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®