Skip to content

Rework V4L2 fwnode parsing; add defaults and avoid iteration

Sakari Ailus linux-media 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest8 patches 0 repliesNew
  2. v38 patches 0 repliesSuperseded
  3. v29 patches 11 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v19 patches6 repliesSuperseded

Changes in v4 from the cover letter

- Address Jacopo's comments (fix documentation and remove extra fwnode_handle_put() in ipu3-cio2.c.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8davinci-vpif: Don't dereference endpoint after putting it, fix refcountingdrivers/media/platform/davinci/vpif_capture.c+2 -30 replies
2/8v4l2-async: Get fwnode reference when putting it to the notifier's listdrivers/media/platform/am437x/am437x-vpfe.c drivers/media/platform/davinci/vpif_capture.c drivers/media/platform/qcom/camss/camss.c +4 more+21 -320 replies
3/8v4l2-async: Add v4l2_async_notifier_add_fwnode_remote_subdevdrivers/media/v4l2-core/v4l2-async.c include/media/v4l2-async.h+48 -00 replies
4/8omap3isp: Rework OF endpoint parsingdrivers/media/platform/omap3isp/isp.c+197 -1340 replies
5/8v4l2-async: Safely clean up an uninitialised notifierdrivers/media/v4l2-core/v4l2-async.c+1 -10 replies
6/8ipu3-cio2: Clean up notifier's subdev list if parsing endpoints failsdrivers/media/pci/intel/ipu3/ipu3-cio2.c+6 -20 replies
7/8ipu3-cio2: Proceed with notifier init even if there are no subdevsdrivers/media/pci/intel/ipu3/ipu3-cio2.c+5 -50 replies
8/8ipu3-cio2: Parse information from firmware without using callbacksdrivers/media/pci/intel/ipu3/ipu3-cio2.c+50 -430 replies

Reviews trailers per patch

2 of 8 patches have a Reviewed-by or Acked-by.

PatchJacopo Mondi
1/8
2/8R-b
3/8
4/8
5/8
6/8
7/8
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/8] Rework V4L2 fwnode parsing; add defaults and avoid iteration

Hi folks,

This patchset reworks V4L2 fwnode endpoint parsing. It enables the use of endpoint configuration defaults that is available sensors and other drivers that only use a single endpoint. Well, the functionality was available already but no driver used it likely because of two reasons:
lack of any examples in a non-trivial problem area as well as lack of a needed functionality to obtain through non-iterative means in the fwnode graph API. Also the fwnode framework did not provide the most convenient APIs to perform this for drivers.

Conversion from the iterative API is done for the omap3isp and ipu3-cio2 drivers. A downside here is that this adds code: what used to be done in the framework in a one-size-fits-all fashion is now the responsibility of the driver. The benefits (default settings and simplicity of the implementation from driver's point of view) are not really achievable without some of that.

I'll send a pull request on these soonish as they've been out for review for a long time with trivial changes in this version only.

since v3:

- Address Jacopo's comments (fix documentation and remove extra fwnode_handle_put() in ipu3-cio2.c.

since v2:

- Postpone fwnode matching by endpoints instead of device nodes.

since v1:

- Fix a typo in ipu3-cio2 driver --- it did not compile.

- Remove unused ret variable.

- Rework the code regarding ret variable in the 2nd patch. That code did not compile until the 3rd patch fixed it.

since RFC v1:

- Add another patch to change fwnode refcounting for v4l2_async_notifier_add_fwnode_subdev

- Add a patch to fix OF node refcounting and use / put order for davinci-vpif

- Don't take endpoint reference in v4l2_async_register_subdev; that's not intended

- Fix kerneldoc documentation for
v4l2_async_notifier_add_fwnode_remote_subdev

- Fix endpoint refcounting in the patch changing fwnode parsing for the omap3isp driver

- Fixed a compiler error in rcar_drif.c --- thanks, Niklas!

Sakari Ailus (8):
davinci-vpif: Don't dereference endpoint after putting it, fix
refcounting
v4l2-async: Get fwnode reference when putting it to the notifier's
list
v4l2-async: Add v4l2_async_notifier_add_fwnode_remote_subdev
omap3isp: Rework OF endpoint parsing
v4l2-async: Safely clean up an uninitialised notifier
ipu3-cio2: Clean up notifier's subdev list if parsing endpoints fails
ipu3-cio2: Proceed with notifier init even if there are no subdevs
ipu3-cio2: Parse information from firmware without using callbacks

 drivers/media/pci/intel/ipu3/ipu3-cio2.c      |  96 ++++----
 drivers/media/platform/am437x/am437x-vpfe.c   |   5 +-
 drivers/media/platform/davinci/vpif_capture.c |  18 +-
 drivers/media/platform/omap3isp/isp.c         | 331 +++++++++++++++-----------
 drivers/media/platform/qcom/camss/camss.c     |   2 +-
 drivers/media/platform/xilinx/xilinx-vipp.c   |   2 +-
 drivers/media/v4l2-core/v4l2-async.c          |  28 ++-
 drivers/media/v4l2-core/v4l2-fwnode.c         |  23 +-
 include/media/v4l2-async.h                    |  30 ++-
 9 files changed, 322 insertions(+), 213 deletions(-)
Signature · 28 lines
2.11.0


Sakari Ailus (8):
  davinci-vpif: Don't dereference endpoint after putting it, fix
    refcounting
  v4l2-async: Get fwnode reference when putting it to the notifier's
    list
  v4l2-async: Add v4l2_async_notifier_add_fwnode_remote_subdev
  omap3isp: Rework OF endpoint parsing
  v4l2-async: Safely clean up an uninitialised notifier
  ipu3-cio2: Clean up notifier's subdev list if parsing endpoints fails
  ipu3-cio2: Proceed with notifier init even if there are no subdevs
  ipu3-cio2: Parse information from firmware without using callbacks

 drivers/media/pci/intel/ipu3/ipu3-cio2.c      |  97 ++++----
 drivers/media/platform/am437x/am437x-vpfe.c   |   5 +-
 drivers/media/platform/davinci/vpif_capture.c |  18 +-
 drivers/media/platform/omap3isp/isp.c         | 331 +++++++++++++++-----------
 drivers/media/platform/qcom/camss/camss.c     |   2 +-
 drivers/media/platform/xilinx/xilinx-vipp.c   |   2 +-
 drivers/media/v4l2-core/v4l2-async.c          |  28 ++-
 drivers/media/v4l2-core/v4l2-fwnode.c         |  23 +-
 include/media/v4l2-async.h                    |  30 ++-
 9 files changed, 323 insertions(+), 213 deletions(-)

-- 
2.11.0