All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/14] V4L2 Async notifier API cleanup
@ 2021-01-18  1:52 Ezequiel Garcia
  2021-01-18  1:52 ` [PATCH v2 01/14] media: v4l2-async: Clean v4l2_async_notifier_add_fwnode_remote_subdev Ezequiel Garcia
                   ` (13 more replies)
  0 siblings, 14 replies; 37+ messages in thread
From: Ezequiel Garcia @ 2021-01-18  1:52 UTC (permalink / raw)
  To: linux-media, Hans Verkuil
  Cc: kernel, Laurent Pinchart, Sakari Ailus, Kieran Bingham,
	Jacopo Mondi, Niklas Söderlund, Helen Koike,
	Dafna Hirschfeld, Hugues Fruchet, Nicolas Ferre, Yong Zhi,
	Sylwester Nawrocki, Maxime Ripard, Robert Foss, Philipp Zabel,
	Ezequiel Garcia

The goal of this series is to make the API more consistent,
also fixing all the drivers which are currently misusing the API.

With this change, the v4l2-async functions that add subdevices
to a notifier have the same semantics, that is they all
allocate a struct v4l2_async_subdev, and take a size argument
for drivers to embed struct v4l2_async_subdev in a larger
struct.

This makes the struct v4l2_async_subdev allocation model
more consistent, and simpler to understand.

The V4L2 sub-devices documentation, as well as the kernel-doc
are also improved a bit, clarifying the API.

Finally, all the drivers previously using v4l2_async_notifier_add_subdev
are converted to proper helpers, which allows us to rename
v4l2_async_notifier_add_subdev to __v4l2_async_notifier_add_subdev,
and clarify the documentation so hopefully future drivers
will avoid it.

I have tried to convert the drivers in the least invasive way,
keeping the original code as much as possible. In many cases,
specially the old drivers, there is some bitrot and some room
for more cleanups, which is beyond the scope of this patchset.

The series is now rebased on top of these patches:
media: v4l2-async: Remove V4L2_ASYNC_MATCH_CUSTOM
media: v4l2-async: Remove V4L2_ASYNC_MATCH_DEVNAME
media: pxa_camera: Drop the v4l2-clk clock register
media: imx6-mipi-csi2: Call remote subdev get_mbus_config to get active lanes

Changes from v1:
* Add Laurent's follow cleanup, which makes the API safer.
* Fix commit description s/is discouraged/will be discouraged
* Fix missing allocation in renesas-ceu driver.
* Fix missing of_node puts in exynos4-is driver.
* Rework mention of v4l2_fwnode_reference_parse_sensor_common 

Ezequiel Garcia (13):
  media: v4l2-async: Clean v4l2_async_notifier_add_fwnode_remote_subdev
  media: atmel: Use v4l2_async_notifier_add_fwnode_remote_subdev
  media: stm32: Use v4l2_async_notifier_add_fwnode_remote_subdev
  media: exynos4-is: Use v4l2_async_notifier_add_fwnode_remote_subdev
  media: st-mipid02: Use v4l2_async_notifier_add_fwnode_remote_subdev
  media: cadence: Use v4l2_async_notifier_add_fwnode_remote_subdev
  media: marvell-ccic: Use v4l2_async_notifier_add_*_subdev
  media: renesas-ceu: Use v4l2_async_notifier_add_*_subdev
  media: pxa-camera: Use v4l2_async_notifier_add_*_subdev
  media: davinci: vpif_display: Remove unused v4l2-async code
  media: v4l2-async: Fix incorrect comment
  media: Clarify v4l2-async subdevice addition API
  media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev

Laurent Pinchart (1):
  media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API

 .../driver-api/media/v4l2-subdev.rst          | 38 ++++++--
 drivers/media/i2c/max9286.c                   |  2 +-
 drivers/media/i2c/st-mipid02.c                | 16 ++--
 drivers/media/pci/intel/ipu3/ipu3-cio2.c      | 15 ++--
 drivers/media/platform/am437x/am437x-vpfe.c   |  2 +-
 drivers/media/platform/atmel/atmel-isc.h      |  1 +
 drivers/media/platform/atmel/atmel-isi.c      | 46 +++-------
 .../media/platform/atmel/atmel-sama5d2-isc.c  | 44 ++++------
 drivers/media/platform/cadence/cdns-csi2rx.c  | 17 ++--
 drivers/media/platform/davinci/vpif_capture.c |  2 +-
 drivers/media/platform/davinci/vpif_display.c | 86 ++++--------------
 drivers/media/platform/davinci/vpif_display.h |  1 -
 drivers/media/platform/exynos4-is/media-dev.c | 26 +++---
 drivers/media/platform/exynos4-is/media-dev.h |  2 +-
 .../media/platform/marvell-ccic/cafe-driver.c | 14 ++-
 .../media/platform/marvell-ccic/mcam-core.c   | 10 ---
 .../media/platform/marvell-ccic/mcam-core.h   |  1 -
 .../media/platform/marvell-ccic/mmp-driver.c  | 11 ++-
 drivers/media/platform/omap3isp/isp.c         | 74 ++++++----------
 drivers/media/platform/pxa_camera.c           | 53 +++++------
 drivers/media/platform/qcom/camss/camss.c     | 11 +--
 drivers/media/platform/rcar-vin/rcar-core.c   |  5 +-
 drivers/media/platform/rcar-vin/rcar-csi2.c   |  2 +-
 drivers/media/platform/rcar_drif.c            |  2 +-
 drivers/media/platform/renesas-ceu.c          | 55 +++++-------
 .../platform/rockchip/rkisp1/rkisp1-dev.c     | 15 +---
 drivers/media/platform/stm32/stm32-dcmi.c     | 87 +++++++------------
 .../platform/sunxi/sun4i-csi/sun4i_csi.c      |  9 +-
 .../platform/sunxi/sun4i-csi/sun4i_csi.h      |  1 -
 drivers/media/platform/ti-vpe/cal.c           | 12 ++-
 drivers/media/platform/video-mux.c            | 14 +--
 drivers/media/platform/xilinx/xilinx-vipp.c   | 10 +--
 drivers/media/v4l2-core/v4l2-async.c          | 54 ++++++------
 drivers/media/v4l2-core/v4l2-fwnode.c         |  6 +-
 drivers/staging/media/imx/imx-media-csi.c     | 14 +--
 drivers/staging/media/imx/imx-media-of.c      |  2 +-
 drivers/staging/media/imx/imx6-mipi-csi2.c    | 19 ++--
 drivers/staging/media/imx/imx7-media-csi.c    | 16 ++--
 drivers/staging/media/imx/imx7-mipi-csis.c    | 15 +---
 drivers/staging/media/tegra-video/vi.c        | 10 +--
 include/media/davinci/vpif_types.h            |  2 -
 include/media/v4l2-async.h                    | 62 ++++++++-----
 42 files changed, 367 insertions(+), 517 deletions(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 37+ messages in thread
* [PATCH v2 00/14] V4L2 Async notifier API cleanup
@ 2021-01-17 18:29 Ezequiel Garcia
  2021-01-17 18:29 ` [PATCH v2 02/14] media: atmel: Use v4l2_async_notifier_add_fwnode_remote_subdev Ezequiel Garcia
  0 siblings, 1 reply; 37+ messages in thread
From: Ezequiel Garcia @ 2021-01-17 18:29 UTC (permalink / raw)
  To: linux-media, Hans Verkuil
  Cc: kernel, Laurent Pinchart, Sakari Ailus, Kieran Bingham,
	Jacopo Mondi, Niklas Söderlund, Mickael Guene, Helen Koike,
	Dafna Hirschfeld, Hugues Fruchet, Nicolas Ferre, Yong Zhi,
	Sylwester Nawrocki, Maxime Ripard, Robert Foss, Philipp Zabel,
	Ezequiel Garcia

The goal of this series is to make the API more consistent,
also fixing all the drivers which are currently misusing the API.

With this change, the v4l2-async functions that add subdevices
to a notifier have the same semantics, that is they all
allocate a struct v4l2_async_subdev, and take a size argument
for drivers to embed struct v4l2_async_subdev in a larger
struct.

This makes the struct v4l2_async_subdev allocation model
more consistent, and simpler to understand.

The V4L2 sub-devices documentation, as well as the kernel-doc
are also improved a bit, clarifying the API.

Finally, all the drivers previously using v4l2_async_notifier_add_subdev
are converted to proper helpers, which allows us to rename
v4l2_async_notifier_add_subdev to __v4l2_async_notifier_add_subdev,
and clarify the documentation so hopefully future drivers
will avoid it.

I have tried to convert the drivers in the least invasive way,
keeping the original code as much as possible. In many cases,
specially the old drivers, there is some bitrot and some room
for more cleanups, which is beyond the scope of this patchset.

The series is now rebased on top of these patches:
media: v4l2-async: Remove V4L2_ASYNC_MATCH_CUSTOM
media: v4l2-async: Remove V4L2_ASYNC_MATCH_DEVNAME
media: pxa_camera: Drop the v4l2-clk clock register
media: imx6-mipi-csi2: Call remote subdev get_mbus_config to get active lanes

Changes from v1:
* Add Laurent's follow cleanup, which makes the API safer.
* Fix commit description s/is discouraged/will be discouraged
* Fix missing allocation in renesas-ceu driver.
* Fix missing of_node puts in exynos4-is driver.
* Rework mention of v4l2_fwnode_reference_parse_sensor_common 

Ezequiel Garcia (13):
  media: v4l2-async: Clean v4l2_async_notifier_add_fwnode_remote_subdev
  media: atmel: Use v4l2_async_notifier_add_fwnode_remote_subdev
  media: stm32: Use v4l2_async_notifier_add_fwnode_remote_subdev
  media: exynos4-is: Use v4l2_async_notifier_add_fwnode_remote_subdev
  media: st-mipid02: Use v4l2_async_notifier_add_fwnode_remote_subdev
  media: cadence: Use v4l2_async_notifier_add_fwnode_remote_subdev
  media: marvell-ccic: Use v4l2_async_notifier_add_*_subdev
  media: renesas-ceu: Use v4l2_async_notifier_add_*_subdev
  media: pxa-camera: Use v4l2_async_notifier_add_*_subdev
  media: davinci: vpif_display: Remove unused v4l2-async code
  media: v4l2-async: Fix incorrect comment
  media: Clarify v4l2-async subdevice addition API
  media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev

Laurent Pinchart (1):
  media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API

 .../driver-api/media/v4l2-subdev.rst          | 38 ++++++--
 drivers/media/i2c/max9286.c                   |  2 +-
 drivers/media/i2c/st-mipid02.c                | 16 ++--
 drivers/media/pci/intel/ipu3/ipu3-cio2.c      | 15 ++--
 drivers/media/platform/am437x/am437x-vpfe.c   |  2 +-
 drivers/media/platform/atmel/atmel-isc.h      |  1 +
 drivers/media/platform/atmel/atmel-isi.c      | 46 +++-------
 .../media/platform/atmel/atmel-sama5d2-isc.c  | 44 ++++------
 drivers/media/platform/cadence/cdns-csi2rx.c  | 17 ++--
 drivers/media/platform/davinci/vpif_capture.c |  2 +-
 drivers/media/platform/davinci/vpif_display.c | 86 ++++--------------
 drivers/media/platform/davinci/vpif_display.h |  1 -
 drivers/media/platform/exynos4-is/media-dev.c | 26 +++---
 drivers/media/platform/exynos4-is/media-dev.h |  2 +-
 .../media/platform/marvell-ccic/cafe-driver.c | 14 ++-
 .../media/platform/marvell-ccic/mcam-core.c   | 10 ---
 .../media/platform/marvell-ccic/mcam-core.h   |  1 -
 .../media/platform/marvell-ccic/mmp-driver.c  | 11 ++-
 drivers/media/platform/omap3isp/isp.c         | 74 ++++++----------
 drivers/media/platform/pxa_camera.c           | 53 +++++------
 drivers/media/platform/qcom/camss/camss.c     | 11 +--
 drivers/media/platform/rcar-vin/rcar-core.c   |  5 +-
 drivers/media/platform/rcar-vin/rcar-csi2.c   |  2 +-
 drivers/media/platform/rcar_drif.c            |  2 +-
 drivers/media/platform/renesas-ceu.c          | 55 +++++-------
 .../platform/rockchip/rkisp1/rkisp1-dev.c     | 15 +---
 drivers/media/platform/stm32/stm32-dcmi.c     | 87 +++++++------------
 .../platform/sunxi/sun4i-csi/sun4i_csi.c      |  9 +-
 .../platform/sunxi/sun4i-csi/sun4i_csi.h      |  1 -
 drivers/media/platform/ti-vpe/cal.c           | 12 ++-
 drivers/media/platform/video-mux.c            | 14 +--
 drivers/media/platform/xilinx/xilinx-vipp.c   | 10 +--
 drivers/media/v4l2-core/v4l2-async.c          | 54 ++++++------
 drivers/media/v4l2-core/v4l2-fwnode.c         |  6 +-
 drivers/staging/media/imx/imx-media-csi.c     | 14 +--
 drivers/staging/media/imx/imx-media-of.c      |  2 +-
 drivers/staging/media/imx/imx6-mipi-csi2.c    | 19 ++--
 drivers/staging/media/imx/imx7-media-csi.c    | 16 ++--
 drivers/staging/media/imx/imx7-mipi-csis.c    | 15 +---
 drivers/staging/media/tegra-video/vi.c        | 10 +--
 include/media/davinci/vpif_types.h            |  2 -
 include/media/v4l2-async.h                    | 62 ++++++++-----
 42 files changed, 367 insertions(+), 517 deletions(-)

-- 
2.29.2


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

end of thread, other threads:[~2021-01-26 19:22 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18  1:52 [PATCH v2 00/14] V4L2 Async notifier API cleanup Ezequiel Garcia
2021-01-18  1:52 ` [PATCH v2 01/14] media: v4l2-async: Clean v4l2_async_notifier_add_fwnode_remote_subdev Ezequiel Garcia
2021-01-19 18:51   ` Helen Koike
2021-01-19 19:45     ` Ezequiel Garcia
2021-01-25 11:02     ` Sakari Ailus
2021-01-25 15:05       ` Helen Koike
2021-01-18  1:52 ` [PATCH v2 02/14] media: atmel: Use v4l2_async_notifier_add_fwnode_remote_subdev Ezequiel Garcia
2021-01-19 18:51   ` Helen Koike
2021-01-18  1:52 ` [PATCH v2 03/14] media: stm32: " Ezequiel Garcia
2021-01-19 18:51   ` Helen Koike
2021-01-18  1:52 ` [PATCH v2 04/14] media: exynos4-is: " Ezequiel Garcia
2021-01-19 18:52   ` Helen Koike
2021-01-19 19:59     ` Ezequiel Garcia
2021-01-18  1:52 ` [PATCH v2 05/14] media: st-mipid02: " Ezequiel Garcia
2021-01-19 18:52   ` Helen Koike
2021-01-19 20:06     ` Ezequiel Garcia
2021-01-18  1:52 ` [PATCH v2 06/14] media: cadence: " Ezequiel Garcia
2021-01-19 18:52   ` Helen Koike
2021-01-18  1:52 ` [PATCH v2 07/14] media: marvell-ccic: Use v4l2_async_notifier_add_*_subdev Ezequiel Garcia
2021-01-19 18:52   ` Helen Koike
2021-01-18  1:52 ` [PATCH v2 08/14] media: renesas-ceu: " Ezequiel Garcia
2021-01-19 18:53   ` Helen Koike
2021-01-18  1:52 ` [PATCH v2 09/14] media: pxa-camera: " Ezequiel Garcia
2021-01-19 18:53   ` Helen Koike
2021-01-18  1:52 ` [PATCH v2 10/14] media: davinci: vpif_display: Remove unused v4l2-async code Ezequiel Garcia
2021-01-19 18:53   ` Helen Koike
2021-01-18  1:52 ` [PATCH v2 11/14] media: v4l2-async: Fix incorrect comment Ezequiel Garcia
2021-01-19 18:54   ` Helen Koike
2021-01-19 20:12     ` Ezequiel Garcia
2021-01-21 10:55       ` Sakari Ailus
2021-01-18  1:52 ` [PATCH v2 12/14] media: Clarify v4l2-async subdevice addition API Ezequiel Garcia
2021-01-19 18:54   ` Helen Koike
2021-01-18  1:52 ` [PATCH v2 13/14] media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev Ezequiel Garcia
2021-01-19 18:54   ` Helen Koike
2021-01-18  1:52 ` [PATCH v2 14/14] media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API Ezequiel Garcia
2021-01-19 18:54   ` Helen Koike
  -- strict thread matches above, loose matches on Subject: below --
2021-01-17 18:29 [PATCH v2 00/14] V4L2 Async notifier API cleanup Ezequiel Garcia
2021-01-17 18:29 ` [PATCH v2 02/14] media: atmel: Use v4l2_async_notifier_add_fwnode_remote_subdev Ezequiel Garcia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.