All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] v4l: async, fwnode: Improve module organisation
@ 2021-03-08 10:02 Sakari Ailus
  2021-03-08 19:01 ` Ezequiel Garcia
  2021-03-10  4:15   ` kernel test robot
  0 siblings, 2 replies; 9+ messages in thread
From: Sakari Ailus @ 2021-03-08 10:02 UTC (permalink / raw
  To: linux-media; +Cc: ezequiel

The V4L2 async framework is generally used with the V4L2 fwnode, which
also depends on the former. There is only one exception, the CAFE_CCIC
driver, which uses V4L2 async but does not need V4L2 fwnode.

At the same time there is a vast number of systems that need videodev
module, but have no use for v4l2-async that's now part of videodev.

In order to improve, build v4l2-async and v4l2-fwnode as a single module
called v4l2-async (the v4l2-async.c file is renamed as v4l2-async-core.c).
Also the menu item V4L2_FWNODE is renamed as V4L2_ASYNC.

This also moves the initialisation of the debufs entries for async subdevs
to loading of the v4l2-async module. The directory is named as
"v4l2-async".

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
This goes on top of my recent async patches.

 drivers/media/i2c/Kconfig                     | 80 +++++++++----------
 drivers/media/i2c/ccs/Kconfig                 |  2 +-
 drivers/media/i2c/et8ek8/Kconfig              |  2 +-
 drivers/media/pci/intel/ipu3/Kconfig          |  2 +-
 drivers/media/platform/Kconfig                | 16 ++--
 drivers/media/platform/am437x/Kconfig         |  2 +-
 drivers/media/platform/atmel/Kconfig          |  4 +-
 drivers/media/platform/cadence/Kconfig        |  4 +-
 drivers/media/platform/davinci/Kconfig        |  2 +-
 drivers/media/platform/exynos4-is/Kconfig     |  4 +-
 drivers/media/platform/marvell-ccic/Kconfig   |  1 +
 drivers/media/platform/rcar-vin/Kconfig       |  4 +-
 .../media/platform/sunxi/sun4i-csi/Kconfig    |  2 +-
 .../media/platform/sunxi/sun6i-csi/Kconfig    |  2 +-
 drivers/media/platform/xilinx/Kconfig         |  2 +-
 drivers/media/v4l2-core/Kconfig               |  3 +-
 drivers/media/v4l2-core/Makefile              |  6 +-
 .../{v4l2-async.c => v4l2-async-core.c}       | 23 +++++-
 drivers/media/v4l2-core/v4l2-dev.c            |  5 --
 drivers/staging/media/imx/Kconfig             |  2 +-
 drivers/staging/media/tegra-video/Kconfig     |  2 +-
 21 files changed, 94 insertions(+), 76 deletions(-)
 rename drivers/media/v4l2-core/{v4l2-async.c => v4l2-async-core.c} (96%)

diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index 462c0e059754..4f9aeefa8a86 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -70,7 +70,7 @@ config VIDEO_TDA1997X
 	depends on SND_SOC
 	select HDMI
 	select SND_PCM
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	help
@@ -240,7 +240,7 @@ config VIDEO_ADV748X
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP_I2C
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  V4L2 subdevice driver for the Analog Devices
 	  ADV7481 and ADV7482 HDMI/Analog video decoders.
@@ -256,7 +256,7 @@ config VIDEO_ADV7604
 	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP_I2C
 	select HDMI
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Support for the Analog Devices ADV7604 video decoder.
 
@@ -369,7 +369,7 @@ config VIDEO_TC358743
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select HDMI
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Support for the Toshiba TC358743 HDMI to MIPI CSI-2 bridge.
 
@@ -387,7 +387,7 @@ config VIDEO_TC358743_CEC
 config VIDEO_TVP514X
 	tristate "Texas Instruments TVP514x video decoder"
 	depends on VIDEO_V4L2 && I2C
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the TI TVP5146/47
 	  decoder. It is currently working with the TI OMAP3 camera
@@ -399,7 +399,7 @@ config VIDEO_TVP514X
 config VIDEO_TVP5150
 	tristate "Texas Instruments TVP5150 video decoder"
 	depends on VIDEO_V4L2 && I2C
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	select REGMAP_I2C
 	help
 	  Support for the Texas Instruments TVP5150 video decoder.
@@ -410,7 +410,7 @@ config VIDEO_TVP5150
 config VIDEO_TVP7002
 	tristate "Texas Instruments TVP7002 video decoder"
 	depends on VIDEO_V4L2 && I2C
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Support for the Texas Instruments TVP7002 video decoder.
 
@@ -468,7 +468,7 @@ config VIDEO_MAX9286
 	tristate "Maxim MAX9286 GMSL deserializer support"
 	depends on I2C && I2C_MUX
 	depends on OF_GPIO
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	select VIDEO_V4L2_SUBDEV_API
 	select MEDIA_CONTROLLER
 	help
@@ -702,7 +702,7 @@ config VIDEO_ST_MIPID02
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Support for STMicroelectronics MIPID02 CSI-2 to PARALLEL bridge.
 	  It is used to allow usage of CSI-2 sensor with PARALLEL port
@@ -730,7 +730,7 @@ config VIDEO_HI556
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the Hynix
 	  Hi-556 camera.
@@ -741,7 +741,7 @@ config VIDEO_HI556
 config VIDEO_IMX214
 	tristate "Sony IMX214 sensor support"
 	depends on GPIOLIB && I2C && VIDEO_V4L2
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP_I2C
@@ -757,7 +757,7 @@ config VIDEO_IMX219
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the Sony
 	  IMX219 camera.
@@ -793,7 +793,7 @@ config VIDEO_IMX290
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP_I2C
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the Sony
 	  IMX290 camera sensor.
@@ -819,7 +819,7 @@ config VIDEO_IMX334
 	depends on I2C && VIDEO_V4L2
 	select VIDEO_V4L2_SUBDEV_API
 	select MEDIA_CONTROLLER
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the Sony
 	  IMX334 camera.
@@ -844,7 +844,7 @@ config VIDEO_OV02A10
 	depends on VIDEO_V4L2 && I2C
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV02A10 camera.
@@ -865,7 +865,7 @@ config VIDEO_OV2640
 config VIDEO_OV2659
 	tristate "OmniVision OV2659 sensor support"
 	depends on VIDEO_V4L2 && I2C && GPIOLIB
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV2659 camera.
@@ -877,7 +877,7 @@ config VIDEO_OV2680
 	tristate "OmniVision OV2680 sensor support"
 	depends on VIDEO_V4L2 && I2C
 	select MEDIA_CONTROLLER
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV2680 camera.
@@ -889,7 +889,7 @@ config VIDEO_OV2685
 	tristate "OmniVision OV2685 sensor support"
 	depends on VIDEO_V4L2 && I2C
 	select MEDIA_CONTROLLER
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV2685 camera.
@@ -903,7 +903,7 @@ config VIDEO_OV2740
 	depends on ACPI || COMPILE_TEST
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	select REGMAP_I2C
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
@@ -918,7 +918,7 @@ config VIDEO_OV5640
 	depends on GPIOLIB && VIDEO_V4L2 && I2C
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the Omnivision
 	  OV5640 camera sensor with a MIPI CSI-2 interface.
@@ -929,7 +929,7 @@ config VIDEO_OV5645
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV5645 camera.
@@ -942,7 +942,7 @@ config VIDEO_OV5647
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV5647 camera.
@@ -955,7 +955,7 @@ config VIDEO_OV5648
 	depends on I2C && PM && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV5648 camera.
@@ -978,7 +978,7 @@ config VIDEO_OV5670
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV5670 camera.
@@ -991,7 +991,7 @@ config VIDEO_OV5675
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV5675 camera.
@@ -1002,7 +1002,7 @@ config VIDEO_OV5675
 config VIDEO_OV5695
 	tristate "OmniVision OV5695 sensor support"
 	depends on I2C && VIDEO_V4L2
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV5695 camera.
@@ -1015,7 +1015,7 @@ config VIDEO_OV7251
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV7251 camera.
@@ -1027,7 +1027,7 @@ config VIDEO_OV772X
 	tristate "OmniVision OV772x sensor support"
 	depends on I2C && VIDEO_V4L2
 	select REGMAP_SCCB
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV772x camera.
@@ -1048,7 +1048,7 @@ config VIDEO_OV7640
 config VIDEO_OV7670
 	tristate "OmniVision OV7670 sensor support"
 	depends on I2C && VIDEO_V4L2
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV7670 VGA camera.  It currently only works with the M88ALP01
@@ -1067,7 +1067,7 @@ config VIDEO_OV8856
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV8856 camera sensor.
@@ -1080,7 +1080,7 @@ config VIDEO_OV8865
 	depends on I2C && PM && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for OmniVision
 	  OV8865 camera sensor.
@@ -1111,7 +1111,7 @@ config VIDEO_OV9734
 	depends on ACPI || COMPILE_TEST
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV9734 camera.
@@ -1124,7 +1124,7 @@ config VIDEO_OV13858
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
 	  OV13858 camera.
@@ -1161,7 +1161,7 @@ config VIDEO_MT9M032
 config VIDEO_MT9M111
 	tristate "mt9m111, mt9m112 and mt9m131 support"
 	depends on I2C && VIDEO_V4L2
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This driver supports MT9M111, MT9M112 and MT9M131 cameras from
 	  Micron/Aptina
@@ -1209,7 +1209,7 @@ config VIDEO_MT9V032
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP_I2C
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a Video4Linux2 sensor driver for the Micron
 	  MT9V032 752x480 CMOS sensor.
@@ -1246,7 +1246,7 @@ config VIDEO_MAX9271_LIB
 config VIDEO_RDACM20
 	tristate "IMI RDACM20 camera support"
 	depends on I2C
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	select VIDEO_V4L2_SUBDEV_API
 	select MEDIA_CONTROLLER
 	select VIDEO_MAX9271_LIB
@@ -1260,7 +1260,7 @@ config VIDEO_RDACM20
 config VIDEO_RDACM21
 	tristate "IMI RDACM21 camera support"
 	depends on I2C
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	select VIDEO_V4L2_SUBDEV_API
 	select MEDIA_CONTROLLER
 	select VIDEO_MAX9271_LIB
@@ -1314,7 +1314,7 @@ config VIDEO_S5K5BAF
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a V4L2 sensor driver for Samsung S5K5BAF 2M
 	  camera sensor with an embedded SoC image signal processor.
@@ -1327,7 +1327,7 @@ config VIDEO_S5C73M3
 	depends on I2C && SPI && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a V4L2 sensor driver for Samsung S5C73M3
 	  8 Mpixel camera.
@@ -1372,7 +1372,7 @@ config VIDEO_DW9768
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a driver for the DW9768 camera lens voice coil.
 	  DW9768 is a 10 bit DAC with 100mA output current sink
diff --git a/drivers/media/i2c/ccs/Kconfig b/drivers/media/i2c/ccs/Kconfig
index 59f35b33ddc1..837c94a5247d 100644
--- a/drivers/media/i2c/ccs/Kconfig
+++ b/drivers/media/i2c/ccs/Kconfig
@@ -5,7 +5,7 @@ config VIDEO_CCS
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select VIDEO_CCS_PLL
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a generic driver for MIPI CCS, SMIA++ and SMIA compliant
 	  camera sensors.
diff --git a/drivers/media/i2c/et8ek8/Kconfig b/drivers/media/i2c/et8ek8/Kconfig
index afcc4ea764f6..d54eeace8c73 100644
--- a/drivers/media/i2c/et8ek8/Kconfig
+++ b/drivers/media/i2c/et8ek8/Kconfig
@@ -4,7 +4,7 @@ config VIDEO_ET8EK8
 	depends on I2C && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a driver for the Toshiba ET8EK8 5 MP camera sensor.
 	  It is used for example in Nokia N900 (RX-51).
diff --git a/drivers/media/pci/intel/ipu3/Kconfig b/drivers/media/pci/intel/ipu3/Kconfig
index dce8274c81e6..2858f9e1ad76 100644
--- a/drivers/media/pci/intel/ipu3/Kconfig
+++ b/drivers/media/pci/intel/ipu3/Kconfig
@@ -6,7 +6,7 @@ config VIDEO_IPU3_CIO2
 	depends on X86
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	select VIDEOBUF2_DMA_SG
 
 	help
diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index fd1831e97b22..3ccd06f8bfc5 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -67,7 +67,7 @@ config VIDEO_MUX
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This driver provides support for N:1 video bus multiplexers.
 
@@ -81,7 +81,7 @@ config VIDEO_OMAP3
 	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select MFD_SYSCON
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Driver for an OMAP 3 camera controller.
 
@@ -97,7 +97,7 @@ config VIDEO_PXA27x
 	depends on PXA27x || COMPILE_TEST
 	select VIDEOBUF2_DMA_SG
 	select SG_SPLIT
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a v4l2 driver for the PXA27x Quick Capture Interface
 
@@ -108,7 +108,7 @@ config VIDEO_QCOM_CAMSS
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_SG
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 
 config VIDEO_S3C_CAMIF
 	tristate "Samsung S3C24XX/S3C64XX SoC Camera Interface driver"
@@ -130,7 +130,7 @@ config VIDEO_STM32_DCMI
 	depends on ARCH_STM32 || COMPILE_TEST
 	select VIDEOBUF2_DMA_CONTIG
 	select MEDIA_CONTROLLER
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This module makes the STM32 Digital Camera Memory Interface (DCMI)
 	  available as a v4l2 device.
@@ -143,7 +143,7 @@ config VIDEO_RENESAS_CEU
 	depends on VIDEO_DEV && VIDEO_V4L2
 	depends on ARCH_SHMOBILE || ARCH_R7S72100 || COMPILE_TEST
 	select VIDEOBUF2_DMA_CONTIG
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a v4l2 driver for the Renesas CEU Interface
 
@@ -155,7 +155,7 @@ config VIDEO_ROCKCHIP_ISP1
 	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select VIDEOBUF2_VMALLOC
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	select GENERIC_PHY_MIPI_DPHY
 	default n
 	help
@@ -179,7 +179,7 @@ config VIDEO_TI_CAL
 	select VIDEO_V4L2_SUBDEV_API
 	depends on SOC_DRA7XX || ARCH_K3 || COMPILE_TEST
 	select VIDEOBUF2_DMA_CONTIG
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Support for the TI CAL (Camera Adaptation Layer) block
 	  found on DRA72X SoC.
diff --git a/drivers/media/platform/am437x/Kconfig b/drivers/media/platform/am437x/Kconfig
index 9ef898f512de..cd7ba318fbb8 100644
--- a/drivers/media/platform/am437x/Kconfig
+++ b/drivers/media/platform/am437x/Kconfig
@@ -6,7 +6,7 @@ config VIDEO_AM437X_VPFE
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	   Support for AM437x Video Processing Front End based Video
 	   Capture Driver.
diff --git a/drivers/media/platform/atmel/Kconfig b/drivers/media/platform/atmel/Kconfig
index 1850fe7f9360..52f427845610 100644
--- a/drivers/media/platform/atmel/Kconfig
+++ b/drivers/media/platform/atmel/Kconfig
@@ -7,7 +7,7 @@ config VIDEO_ATMEL_ISC
 	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select REGMAP_MMIO
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	   This module makes the ATMEL Image Sensor Controller available
 	   as a v4l2 device.
@@ -17,7 +17,7 @@ config VIDEO_ATMEL_ISI
 	depends on VIDEO_V4L2 && OF
 	depends on ARCH_AT91 || COMPILE_TEST
 	select VIDEOBUF2_DMA_CONTIG
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This module makes the ATMEL Image Sensor Interface available
 	  as a v4l2 device.
diff --git a/drivers/media/platform/cadence/Kconfig b/drivers/media/platform/cadence/Kconfig
index 80cf601323ce..5cb54d661e83 100644
--- a/drivers/media/platform/cadence/Kconfig
+++ b/drivers/media/platform/cadence/Kconfig
@@ -15,7 +15,7 @@ config VIDEO_CADENCE_CSI2RX
 	depends on VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Support for the Cadence MIPI CSI2 Receiver controller.
 
@@ -27,7 +27,7 @@ config VIDEO_CADENCE_CSI2TX
 	depends on VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Support for the Cadence MIPI CSI2 Transceiver controller.
 
diff --git a/drivers/media/platform/davinci/Kconfig b/drivers/media/platform/davinci/Kconfig
index 9d2a9eeb3499..ca7c61fbc4d3 100644
--- a/drivers/media/platform/davinci/Kconfig
+++ b/drivers/media/platform/davinci/Kconfig
@@ -21,7 +21,7 @@ config VIDEO_DAVINCI_VPIF_CAPTURE
 	depends on ARCH_DAVINCI || COMPILE_TEST
 	depends on I2C
 	select VIDEOBUF2_DMA_CONTIG
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Enables Davinci VPIF module used for capture devices.
 	  This module is used for capture on TI DM6467/DA850/OMAPL138
diff --git a/drivers/media/platform/exynos4-is/Kconfig b/drivers/media/platform/exynos4-is/Kconfig
index 136d3b2a0fbb..c97393bc334e 100644
--- a/drivers/media/platform/exynos4-is/Kconfig
+++ b/drivers/media/platform/exynos4-is/Kconfig
@@ -6,7 +6,7 @@ config VIDEO_SAMSUNG_EXYNOS4_IS
 	depends on ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Say Y here to enable camera host interface devices for
 	  Samsung S5P and EXYNOS SoC series.
@@ -35,7 +35,7 @@ config VIDEO_S5P_MIPI_CSIS
 	tristate "S5P/EXYNOS MIPI-CSI2 receiver (MIPI-CSIS) driver"
 	depends on REGULATOR
 	select GENERIC_PHY
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC MIPI-CSI2
 	  receiver (MIPI-CSIS) devices.
diff --git a/drivers/media/platform/marvell-ccic/Kconfig b/drivers/media/platform/marvell-ccic/Kconfig
index 3e3f86264762..88eefffe68c2 100644
--- a/drivers/media/platform/marvell-ccic/Kconfig
+++ b/drivers/media/platform/marvell-ccic/Kconfig
@@ -7,6 +7,7 @@ config VIDEO_CAFE_CCIC
 	select VIDEOBUF2_VMALLOC
 	select VIDEOBUF2_DMA_CONTIG
 	select VIDEOBUF2_DMA_SG
+	select V4L2_ASYNC
 	help
 	  This is a video4linux2 driver for the Marvell 88ALP01 integrated
 	  CMOS camera controller.  This is the controller found on first-
diff --git a/drivers/media/platform/rcar-vin/Kconfig b/drivers/media/platform/rcar-vin/Kconfig
index 030312d862e7..bf9d724f121c 100644
--- a/drivers/media/platform/rcar-vin/Kconfig
+++ b/drivers/media/platform/rcar-vin/Kconfig
@@ -6,7 +6,7 @@ config VIDEO_RCAR_CSI2
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select RESET_CONTROLLER
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Support for Renesas R-Car MIPI CSI-2 receiver.
 	  Supports R-Car Gen3 and RZ/G2 SoCs.
@@ -21,7 +21,7 @@ config VIDEO_RCAR_VIN
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Support for Renesas R-Car Video Input (VIN) driver.
 	  Supports R-Car Gen{2,3} and RZ/G{1,2} SoCs.
diff --git a/drivers/media/platform/sunxi/sun4i-csi/Kconfig b/drivers/media/platform/sunxi/sun4i-csi/Kconfig
index 903c6152f6e8..4ae510b51310 100644
--- a/drivers/media/platform/sunxi/sun4i-csi/Kconfig
+++ b/drivers/media/platform/sunxi/sun4i-csi/Kconfig
@@ -7,7 +7,7 @@ config VIDEO_SUN4I_CSI
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  This is a V4L2 driver for the Allwinner A10 CSI
 
diff --git a/drivers/media/platform/sunxi/sun6i-csi/Kconfig b/drivers/media/platform/sunxi/sun6i-csi/Kconfig
index 586e3fb3a80d..6815f73027d5 100644
--- a/drivers/media/platform/sunxi/sun6i-csi/Kconfig
+++ b/drivers/media/platform/sunxi/sun6i-csi/Kconfig
@@ -7,6 +7,6 @@ config VIDEO_SUN6I_CSI
 	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select REGMAP_MMIO
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	   Support for the Allwinner Camera Sensor Interface Controller on V3s.
diff --git a/drivers/media/platform/xilinx/Kconfig b/drivers/media/platform/xilinx/Kconfig
index 44587dccacf1..7d6b1b04b007 100644
--- a/drivers/media/platform/xilinx/Kconfig
+++ b/drivers/media/platform/xilinx/Kconfig
@@ -6,7 +6,7 @@ config VIDEO_XILINX
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Driver for Xilinx Video IP Pipelines
 
diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
index bf49f83cb86f..26e12db0a4e8 100644
--- a/drivers/media/v4l2-core/Kconfig
+++ b/drivers/media/v4l2-core/Kconfig
@@ -62,13 +62,14 @@ config V4L2_FLASH_LED_CLASS
 	tristate "V4L2 flash API for LED flash class devices"
 	depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
 	depends on LEDS_CLASS_FLASH
+	select V4L2_ASYNC
 	help
 	  Say Y here to enable V4L2 flash API support for LED flash
 	  class drivers.
 
 	  When in doubt, say N.
 
-config V4L2_FWNODE
+config V4L2_ASYNC
 	tristate
 
 # Used by drivers that need Videobuf modules
diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
index e4cd589b99a5..298ca6ba4f32 100644
--- a/drivers/media/v4l2-core/Makefile
+++ b/drivers/media/v4l2-core/Makefile
@@ -7,14 +7,16 @@ tuner-objs	:=	tuner-core.o
 
 videodev-objs	:=	v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-fh.o \
 			v4l2-event.o v4l2-ctrls.o v4l2-subdev.o \
-			v4l2-async.o v4l2-common.o
+			v4l2-common.o
 videodev-$(CONFIG_COMPAT) += v4l2-compat-ioctl32.o
 videodev-$(CONFIG_TRACEPOINTS) += v4l2-trace.o
 videodev-$(CONFIG_MEDIA_CONTROLLER) += v4l2-mc.o
 videodev-$(CONFIG_SPI) += v4l2-spi.o
 videodev-$(CONFIG_VIDEO_V4L2_I2C) += v4l2-i2c.o
 
-obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o
+v4l2-async-objs :=	v4l2-async-core.o v4l2-fwnode.o
+
+obj-$(CONFIG_V4L2_ASYNC) += v4l2-async.o
 obj-$(CONFIG_VIDEO_V4L2) += videodev.o
 obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o
 
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async-core.c
similarity index 96%
rename from drivers/media/v4l2-core/v4l2-async.c
rename to drivers/media/v4l2-core/v4l2-async-core.c
index 21b3890b96fc..6e49386f0284 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async-core.c
@@ -852,8 +852,27 @@ static int pending_subdevs_show(struct seq_file *s, void *data)
 }
 DEFINE_SHOW_ATTRIBUTE(pending_subdevs);
 
-void v4l2_async_debug_init(struct dentry *debugfs_dir)
+static struct dentry *v4l2_async_debugfs_dir;
+
+static int __init v4l2_async_init(void)
 {
-	debugfs_create_file("pending_async_subdevices", 0444, debugfs_dir, NULL,
+	v4l2_async_debugfs_dir = debugfs_create_dir("v4l2-async", NULL);
+	debugfs_create_file("pending_async_subdevices", 0444,
+			    v4l2_async_debugfs_dir, NULL,
 			    &pending_subdevs_fops);
+
+	return 0;
+}
+
+static void __exit v4l2_async_exit(void)
+{
+	debugfs_remove_recursive(v4l2_async_debugfs_dir);
 }
+
+subsys_initcall(v4l2_async_init);
+module_exit(v4l2_async_exit);
+
+MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>");
+MODULE_AUTHOR("Sakari Ailus <sakari.ailus@linux.intel.com>");
+MODULE_AUTHOR("Ezequiel Garcia <ezequiel@collabora.com>");
+MODULE_LICENSE("GPL");
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index b6a72d297775..5002e3cd110f 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -39,8 +39,6 @@
 		       __func__, ##arg);				\
 } while (0)
 
-static struct dentry *v4l2_debugfs_dir;
-
 /*
  *	sysfs stuff
  */
@@ -1120,8 +1118,6 @@ static int __init videodev_init(void)
 		return -EIO;
 	}
 
-	v4l2_debugfs_dir = debugfs_create_dir("video4linux", NULL);
-	v4l2_async_debug_init(v4l2_debugfs_dir);
 	return 0;
 }
 
@@ -1129,7 +1125,6 @@ static void __exit videodev_exit(void)
 {
 	dev_t dev = MKDEV(VIDEO_MAJOR, 0);
 
-	debugfs_remove_recursive(v4l2_debugfs_dir);
 	class_unregister(&video_class);
 	unregister_chrdev_region(dev, VIDEO_NUM_DEVICES);
 }
diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig
index 15322dc3124a..c536e8562788 100644
--- a/drivers/staging/media/imx/Kconfig
+++ b/drivers/staging/media/imx/Kconfig
@@ -7,7 +7,7 @@ config VIDEO_IMX_MEDIA
 	select VIDEO_V4L2_SUBDEV_API
 	depends on HAS_DMA
 	select VIDEOBUF2_DMA_CONTIG
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	select V4L2_MEM2MEM_DEV
 	help
 	  Say yes here to enable support for video4linux media controller
diff --git a/drivers/staging/media/tegra-video/Kconfig b/drivers/staging/media/tegra-video/Kconfig
index 1f35da4b134e..3ab34c7fa5e9 100644
--- a/drivers/staging/media/tegra-video/Kconfig
+++ b/drivers/staging/media/tegra-video/Kconfig
@@ -5,7 +5,7 @@ config VIDEO_TEGRA
 	depends on VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select VIDEOBUF2_DMA_CONTIG
-	select V4L2_FWNODE
+	select V4L2_ASYNC
 	help
 	  Choose this option if you have an NVIDIA Tegra SoC.
 
-- 
2.29.2


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

* Re: [PATCH 1/1] v4l: async, fwnode: Improve module organisation
  2021-03-08 10:02 [PATCH 1/1] v4l: async, fwnode: Improve module organisation Sakari Ailus
@ 2021-03-08 19:01 ` Ezequiel Garcia
  2021-03-09 10:03   ` Sakari Ailus
  2021-03-10  4:15   ` kernel test robot
  1 sibling, 1 reply; 9+ messages in thread
From: Ezequiel Garcia @ 2021-03-08 19:01 UTC (permalink / raw
  To: Sakari Ailus, linux-media

Hi Sakari,

Thanks a lot for the patch. I like where this is going.

On Mon, 2021-03-08 at 12:02 +0200, Sakari Ailus wrote:
> The V4L2 async framework is generally used with the V4L2 fwnode, which
> also depends on the former. There is only one exception, the CAFE_CCIC
> driver, which uses V4L2 async but does not need V4L2 fwnode.
> 
> At the same time there is a vast number of systems that need videodev
> module, but have no use for v4l2-async that's now part of videodev.
> 
> In order to improve, build v4l2-async and v4l2-fwnode as a single module
> called v4l2-async (the v4l2-async.c file is renamed as v4l2-async-core.c).
> Also the menu item V4L2_FWNODE is renamed as V4L2_ASYNC.
> 
> This also moves the initialisation of the debufs entries for async subdevs
> to loading of the v4l2-async module. The directory is named as
> "v4l2-async".
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> This goes on top of my recent async patches.
> 
>  drivers/media/i2c/Kconfig                     | 80 +++++++++----------
>  drivers/media/i2c/ccs/Kconfig                 |  2 +-
>  drivers/media/i2c/et8ek8/Kconfig              |  2 +-
>  drivers/media/pci/intel/ipu3/Kconfig          |  2 +-
>  drivers/media/platform/Kconfig                | 16 ++--
>  drivers/media/platform/am437x/Kconfig         |  2 +-
>  drivers/media/platform/atmel/Kconfig          |  4 +-
>  drivers/media/platform/cadence/Kconfig        |  4 +-
>  drivers/media/platform/davinci/Kconfig        |  2 +-
>  drivers/media/platform/exynos4-is/Kconfig     |  4 +-
>  drivers/media/platform/marvell-ccic/Kconfig   |  1 +
>  drivers/media/platform/rcar-vin/Kconfig       |  4 +-
>  .../media/platform/sunxi/sun4i-csi/Kconfig    |  2 +-
>  .../media/platform/sunxi/sun6i-csi/Kconfig    |  2 +-
>  drivers/media/platform/xilinx/Kconfig         |  2 +-
>  drivers/media/v4l2-core/Kconfig               |  3 +-
>  drivers/media/v4l2-core/Makefile              |  6 +-
>  .../{v4l2-async.c => v4l2-async-core.c}       | 23 +++++-
>  drivers/media/v4l2-core/v4l2-dev.c            |  5 --
>  drivers/staging/media/imx/Kconfig             |  2 +-
>  drivers/staging/media/tegra-video/Kconfig     |  2 +-
>  21 files changed, 94 insertions(+), 76 deletions(-)
>  rename drivers/media/v4l2-core/{v4l2-async.c => v4l2-async-core.c} (96%)
> 
[..]
> diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> index bf49f83cb86f..26e12db0a4e8 100644
> --- a/drivers/media/v4l2-core/Kconfig
> +++ b/drivers/media/v4l2-core/Kconfig
> @@ -62,13 +62,14 @@ config V4L2_FLASH_LED_CLASS
>         tristate "V4L2 flash API for LED flash class devices"
>         depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
>         depends on LEDS_CLASS_FLASH
> +       select V4L2_ASYNC
>         help
>           Say Y here to enable V4L2 flash API support for LED flash
>           class drivers.
>  
>           When in doubt, say N.
>  
> -config V4L2_FWNODE
> +config V4L2_ASYNC
>         tristate
>  

So we don't expect (or want) out-of-tree drivers to be able to use this.
Is that correct?

>  # Used by drivers that need Videobuf modules
> diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
> index e4cd589b99a5..298ca6ba4f32 100644
> --- a/drivers/media/v4l2-core/Makefile
> +++ b/drivers/media/v4l2-core/Makefile
> @@ -7,14 +7,16 @@ tuner-objs    :=      tuner-core.o
>  
>  videodev-objs  :=      v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-fh.o \
>                         v4l2-event.o v4l2-ctrls.o v4l2-subdev.o \
> -                       v4l2-async.o v4l2-common.o
> +                       v4l2-common.o
>  videodev-$(CONFIG_COMPAT) += v4l2-compat-ioctl32.o
>  videodev-$(CONFIG_TRACEPOINTS) += v4l2-trace.o
>  videodev-$(CONFIG_MEDIA_CONTROLLER) += v4l2-mc.o
>  videodev-$(CONFIG_SPI) += v4l2-spi.o
>  videodev-$(CONFIG_VIDEO_V4L2_I2C) += v4l2-i2c.o
>  
> -obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o
> +v4l2-async-objs :=     v4l2-async-core.o v4l2-fwnode.o
> +

Looks good.

> +obj-$(CONFIG_V4L2_ASYNC) += v4l2-async.o
>  obj-$(CONFIG_VIDEO_V4L2) += videodev.o
>  obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o
>  
> diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async-core.c
> similarity index 96%
> rename from drivers/media/v4l2-core/v4l2-async.c
> rename to drivers/media/v4l2-core/v4l2-async-core.c
> index 21b3890b96fc..6e49386f0284 100644
> --- a/drivers/media/v4l2-core/v4l2-async.c
> +++ b/drivers/media/v4l2-core/v4l2-async-core.c
> @@ -852,8 +852,27 @@ static int pending_subdevs_show(struct seq_file *s, void *data)
>  }
>  DEFINE_SHOW_ATTRIBUTE(pending_subdevs);
>  
> -void v4l2_async_debug_init(struct dentry *debugfs_dir)
> +static struct dentry *v4l2_async_debugfs_dir;
> +
> +static int __init v4l2_async_init(void)
>  {
> -       debugfs_create_file("pending_async_subdevices", 0444, debugfs_dir, NULL,
> +       v4l2_async_debugfs_dir = debugfs_create_dir("v4l2-async", NULL);
> +       debugfs_create_file("pending_async_subdevices", 0444,
> +                           v4l2_async_debugfs_dir, NULL,
>                             &pending_subdevs_fops);

I guess we could have kept the previous path,
but OTOH it's not really a big deal for debugfs.

Once we figure out the above about exposing V4L2_ASYNC:

Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>

Thanks,
Ezequiel


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

* Re: [PATCH 1/1] v4l: async, fwnode: Improve module organisation
  2021-03-08 19:01 ` Ezequiel Garcia
@ 2021-03-09 10:03   ` Sakari Ailus
  2021-03-09 12:22     ` Ezequiel Garcia
  0 siblings, 1 reply; 9+ messages in thread
From: Sakari Ailus @ 2021-03-09 10:03 UTC (permalink / raw
  To: Ezequiel Garcia; +Cc: linux-media

Hi Ezequiel,

On Mon, Mar 08, 2021 at 04:01:58PM -0300, Ezequiel Garcia wrote:
> Hi Sakari,
> 
> Thanks a lot for the patch. I like where this is going.

Thanks for the review, too!

> 
> On Mon, 2021-03-08 at 12:02 +0200, Sakari Ailus wrote:
> > The V4L2 async framework is generally used with the V4L2 fwnode, which
> > also depends on the former. There is only one exception, the CAFE_CCIC
> > driver, which uses V4L2 async but does not need V4L2 fwnode.
> > 
> > At the same time there is a vast number of systems that need videodev
> > module, but have no use for v4l2-async that's now part of videodev.
> > 
> > In order to improve, build v4l2-async and v4l2-fwnode as a single module
> > called v4l2-async (the v4l2-async.c file is renamed as v4l2-async-core.c).
> > Also the menu item V4L2_FWNODE is renamed as V4L2_ASYNC.
> > 
> > This also moves the initialisation of the debufs entries for async subdevs
> > to loading of the v4l2-async module. The directory is named as
> > "v4l2-async".
> > 
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > ---
> > This goes on top of my recent async patches.
> > 
> >  drivers/media/i2c/Kconfig                     | 80 +++++++++----------
> >  drivers/media/i2c/ccs/Kconfig                 |  2 +-
> >  drivers/media/i2c/et8ek8/Kconfig              |  2 +-
> >  drivers/media/pci/intel/ipu3/Kconfig          |  2 +-
> >  drivers/media/platform/Kconfig                | 16 ++--
> >  drivers/media/platform/am437x/Kconfig         |  2 +-
> >  drivers/media/platform/atmel/Kconfig          |  4 +-
> >  drivers/media/platform/cadence/Kconfig        |  4 +-
> >  drivers/media/platform/davinci/Kconfig        |  2 +-
> >  drivers/media/platform/exynos4-is/Kconfig     |  4 +-
> >  drivers/media/platform/marvell-ccic/Kconfig   |  1 +
> >  drivers/media/platform/rcar-vin/Kconfig       |  4 +-
> >  .../media/platform/sunxi/sun4i-csi/Kconfig    |  2 +-
> >  .../media/platform/sunxi/sun6i-csi/Kconfig    |  2 +-
> >  drivers/media/platform/xilinx/Kconfig         |  2 +-
> >  drivers/media/v4l2-core/Kconfig               |  3 +-
> >  drivers/media/v4l2-core/Makefile              |  6 +-
> >  .../{v4l2-async.c => v4l2-async-core.c}       | 23 +++++-
> >  drivers/media/v4l2-core/v4l2-dev.c            |  5 --
> >  drivers/staging/media/imx/Kconfig             |  2 +-
> >  drivers/staging/media/tegra-video/Kconfig     |  2 +-
> >  21 files changed, 94 insertions(+), 76 deletions(-)
> >  rename drivers/media/v4l2-core/{v4l2-async.c => v4l2-async-core.c} (96%)
> > 
> [..]
> > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> > index bf49f83cb86f..26e12db0a4e8 100644
> > --- a/drivers/media/v4l2-core/Kconfig
> > +++ b/drivers/media/v4l2-core/Kconfig
> > @@ -62,13 +62,14 @@ config V4L2_FLASH_LED_CLASS
> >         tristate "V4L2 flash API for LED flash class devices"
> >         depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
> >         depends on LEDS_CLASS_FLASH
> > +       select V4L2_ASYNC
> >         help
> >           Say Y here to enable V4L2 flash API support for LED flash
> >           class drivers.
> >  
> >           When in doubt, say N.
> >  
> > -config V4L2_FWNODE
> > +config V4L2_ASYNC
> >         tristate
> >  
> 
> So we don't expect (or want) out-of-tree drivers to be able to use this.
> Is that correct?

Hmm. I somehow manage to miss how this is related to out-of-tree drivers.

They do need to be adapted to the change though.

> 
> >  # Used by drivers that need Videobuf modules
> > diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
> > index e4cd589b99a5..298ca6ba4f32 100644
> > --- a/drivers/media/v4l2-core/Makefile
> > +++ b/drivers/media/v4l2-core/Makefile
> > @@ -7,14 +7,16 @@ tuner-objs    :=      tuner-core.o
> >  
> >  videodev-objs  :=      v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-fh.o \
> >                         v4l2-event.o v4l2-ctrls.o v4l2-subdev.o \
> > -                       v4l2-async.o v4l2-common.o
> > +                       v4l2-common.o
> >  videodev-$(CONFIG_COMPAT) += v4l2-compat-ioctl32.o
> >  videodev-$(CONFIG_TRACEPOINTS) += v4l2-trace.o
> >  videodev-$(CONFIG_MEDIA_CONTROLLER) += v4l2-mc.o
> >  videodev-$(CONFIG_SPI) += v4l2-spi.o
> >  videodev-$(CONFIG_VIDEO_V4L2_I2C) += v4l2-i2c.o
> >  
> > -obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o
> > +v4l2-async-objs :=     v4l2-async-core.o v4l2-fwnode.o
> > +
> 
> Looks good.
> 
> > +obj-$(CONFIG_V4L2_ASYNC) += v4l2-async.o
> >  obj-$(CONFIG_VIDEO_V4L2) += videodev.o
> >  obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o
> >  
> > diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async-core.c
> > similarity index 96%
> > rename from drivers/media/v4l2-core/v4l2-async.c
> > rename to drivers/media/v4l2-core/v4l2-async-core.c
> > index 21b3890b96fc..6e49386f0284 100644
> > --- a/drivers/media/v4l2-core/v4l2-async.c
> > +++ b/drivers/media/v4l2-core/v4l2-async-core.c
> > @@ -852,8 +852,27 @@ static int pending_subdevs_show(struct seq_file *s, void *data)
> >  }
> >  DEFINE_SHOW_ATTRIBUTE(pending_subdevs);
> >  
> > -void v4l2_async_debug_init(struct dentry *debugfs_dir)
> > +static struct dentry *v4l2_async_debugfs_dir;
> > +
> > +static int __init v4l2_async_init(void)
> >  {
> > -       debugfs_create_file("pending_async_subdevices", 0444, debugfs_dir, NULL,
> > +       v4l2_async_debugfs_dir = debugfs_create_dir("v4l2-async", NULL);
> > +       debugfs_create_file("pending_async_subdevices", 0444,
> > +                           v4l2_async_debugfs_dir, NULL,
> >                             &pending_subdevs_fops);
> 
> I guess we could have kept the previous path,
> but OTOH it's not really a big deal for debugfs.

If debugfs bits are added to V4L2 framework, it will be different from the
above debugfs path. Otherwise the two will in practice be part of the same
module. And if it's going to change, it's better to change it now than
later.

> 
> Once we figure out the above about exposing V4L2_ASYNC:
> 
> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>

Thanks!

-- 
Kind regards,

Sakari Ailus

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

* Re: [PATCH 1/1] v4l: async, fwnode: Improve module organisation
  2021-03-09 10:03   ` Sakari Ailus
@ 2021-03-09 12:22     ` Ezequiel Garcia
  2021-03-09 22:21       ` Sakari Ailus
  0 siblings, 1 reply; 9+ messages in thread
From: Ezequiel Garcia @ 2021-03-09 12:22 UTC (permalink / raw
  To: Sakari Ailus; +Cc: linux-media

On Tue, 2021-03-09 at 12:03 +0200, Sakari Ailus wrote:
> Hi Ezequiel,
> 
> On Mon, Mar 08, 2021 at 04:01:58PM -0300, Ezequiel Garcia wrote:
> > Hi Sakari,
> > 
> > Thanks a lot for the patch. I like where this is going.
> 
> Thanks for the review, too!
> 
> > 
> > On Mon, 2021-03-08 at 12:02 +0200, Sakari Ailus wrote:
> > > The V4L2 async framework is generally used with the V4L2 fwnode, which
> > > also depends on the former. There is only one exception, the CAFE_CCIC
> > > driver, which uses V4L2 async but does not need V4L2 fwnode.
> > > 
> > > At the same time there is a vast number of systems that need videodev
> > > module, but have no use for v4l2-async that's now part of videodev.
> > > 
> > > In order to improve, build v4l2-async and v4l2-fwnode as a single module
> > > called v4l2-async (the v4l2-async.c file is renamed as v4l2-async-core.c).
> > > Also the menu item V4L2_FWNODE is renamed as V4L2_ASYNC.
> > > 
> > > This also moves the initialisation of the debufs entries for async subdevs
> > > to loading of the v4l2-async module. The directory is named as
> > > "v4l2-async".
> > > 
> > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > > ---
> > > This goes on top of my recent async patches.
> > > 
> > >  drivers/media/i2c/Kconfig                     | 80 +++++++++----------
> > >  drivers/media/i2c/ccs/Kconfig                 |  2 +-
> > >  drivers/media/i2c/et8ek8/Kconfig              |  2 +-
> > >  drivers/media/pci/intel/ipu3/Kconfig          |  2 +-
> > >  drivers/media/platform/Kconfig                | 16 ++--
> > >  drivers/media/platform/am437x/Kconfig         |  2 +-
> > >  drivers/media/platform/atmel/Kconfig          |  4 +-
> > >  drivers/media/platform/cadence/Kconfig        |  4 +-
> > >  drivers/media/platform/davinci/Kconfig        |  2 +-
> > >  drivers/media/platform/exynos4-is/Kconfig     |  4 +-
> > >  drivers/media/platform/marvell-ccic/Kconfig   |  1 +
> > >  drivers/media/platform/rcar-vin/Kconfig       |  4 +-
> > >  .../media/platform/sunxi/sun4i-csi/Kconfig    |  2 +-
> > >  .../media/platform/sunxi/sun6i-csi/Kconfig    |  2 +-
> > >  drivers/media/platform/xilinx/Kconfig         |  2 +-
> > >  drivers/media/v4l2-core/Kconfig               |  3 +-
> > >  drivers/media/v4l2-core/Makefile              |  6 +-
> > >  .../{v4l2-async.c => v4l2-async-core.c}       | 23 +++++-
> > >  drivers/media/v4l2-core/v4l2-dev.c            |  5 --
> > >  drivers/staging/media/imx/Kconfig             |  2 +-
> > >  drivers/staging/media/tegra-video/Kconfig     |  2 +-
> > >  21 files changed, 94 insertions(+), 76 deletions(-)
> > >  rename drivers/media/v4l2-core/{v4l2-async.c => v4l2-async-core.c} (96%)
> > > 
> > [..]
> > > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> > > index bf49f83cb86f..26e12db0a4e8 100644
> > > --- a/drivers/media/v4l2-core/Kconfig
> > > +++ b/drivers/media/v4l2-core/Kconfig
> > > @@ -62,13 +62,14 @@ config V4L2_FLASH_LED_CLASS
> > >         tristate "V4L2 flash API for LED flash class devices"
> > >         depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
> > >         depends on LEDS_CLASS_FLASH
> > > +       select V4L2_ASYNC
> > >         help
> > >           Say Y here to enable V4L2 flash API support for LED flash
> > >           class drivers.
> > >  
> > >           When in doubt, say N.
> > >  
> > > -config V4L2_FWNODE
> > > +config V4L2_ASYNC
> > >         tristate
> > >  
> > 
> > So we don't expect (or want) out-of-tree drivers to be able to use this.
> > Is that correct?
> 
> Hmm. I somehow manage to miss how this is related to out-of-tree drivers.
> 

As it is, the v4l2-async module is not user-selectable, because
V4L2_ASYNC has no prompt (the symbol is non-visible).

For the user to be able to select the v4l2-async module,
even if no driver is selecting it, it needs a prompt: 

config V4L2_ASYNC
	tristate "V4L2 asynchronous subdevice support"

This is usually useful for out-of-tree drivers, AFAIK.

Cheers,
Eze


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

* Re: [PATCH 1/1] v4l: async, fwnode: Improve module organisation
  2021-03-09 12:22     ` Ezequiel Garcia
@ 2021-03-09 22:21       ` Sakari Ailus
  2021-03-12 14:50         ` Ezequiel Garcia
  0 siblings, 1 reply; 9+ messages in thread
From: Sakari Ailus @ 2021-03-09 22:21 UTC (permalink / raw
  To: Ezequiel Garcia; +Cc: linux-media

Hi Ezequiel,

On Tue, Mar 09, 2021 at 09:22:16AM -0300, Ezequiel Garcia wrote:
> On Tue, 2021-03-09 at 12:03 +0200, Sakari Ailus wrote:
> > Hi Ezequiel,
> > 
> > On Mon, Mar 08, 2021 at 04:01:58PM -0300, Ezequiel Garcia wrote:
> > > Hi Sakari,
> > > 
> > > Thanks a lot for the patch. I like where this is going.
> > 
> > Thanks for the review, too!
> > 
> > > 
> > > On Mon, 2021-03-08 at 12:02 +0200, Sakari Ailus wrote:
> > > > The V4L2 async framework is generally used with the V4L2 fwnode, which
> > > > also depends on the former. There is only one exception, the CAFE_CCIC
> > > > driver, which uses V4L2 async but does not need V4L2 fwnode.
> > > > 
> > > > At the same time there is a vast number of systems that need videodev
> > > > module, but have no use for v4l2-async that's now part of videodev.
> > > > 
> > > > In order to improve, build v4l2-async and v4l2-fwnode as a single module
> > > > called v4l2-async (the v4l2-async.c file is renamed as v4l2-async-core.c).
> > > > Also the menu item V4L2_FWNODE is renamed as V4L2_ASYNC.
> > > > 
> > > > This also moves the initialisation of the debufs entries for async subdevs
> > > > to loading of the v4l2-async module. The directory is named as
> > > > "v4l2-async".
> > > > 
> > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > > > ---
> > > > This goes on top of my recent async patches.
> > > > 
> > > >  drivers/media/i2c/Kconfig                     | 80 +++++++++----------
> > > >  drivers/media/i2c/ccs/Kconfig                 |  2 +-
> > > >  drivers/media/i2c/et8ek8/Kconfig              |  2 +-
> > > >  drivers/media/pci/intel/ipu3/Kconfig          |  2 +-
> > > >  drivers/media/platform/Kconfig                | 16 ++--
> > > >  drivers/media/platform/am437x/Kconfig         |  2 +-
> > > >  drivers/media/platform/atmel/Kconfig          |  4 +-
> > > >  drivers/media/platform/cadence/Kconfig        |  4 +-
> > > >  drivers/media/platform/davinci/Kconfig        |  2 +-
> > > >  drivers/media/platform/exynos4-is/Kconfig     |  4 +-
> > > >  drivers/media/platform/marvell-ccic/Kconfig   |  1 +
> > > >  drivers/media/platform/rcar-vin/Kconfig       |  4 +-
> > > >  .../media/platform/sunxi/sun4i-csi/Kconfig    |  2 +-
> > > >  .../media/platform/sunxi/sun6i-csi/Kconfig    |  2 +-
> > > >  drivers/media/platform/xilinx/Kconfig         |  2 +-
> > > >  drivers/media/v4l2-core/Kconfig               |  3 +-
> > > >  drivers/media/v4l2-core/Makefile              |  6 +-
> > > >  .../{v4l2-async.c => v4l2-async-core.c}       | 23 +++++-
> > > >  drivers/media/v4l2-core/v4l2-dev.c            |  5 --
> > > >  drivers/staging/media/imx/Kconfig             |  2 +-
> > > >  drivers/staging/media/tegra-video/Kconfig     |  2 +-
> > > >  21 files changed, 94 insertions(+), 76 deletions(-)
> > > >  rename drivers/media/v4l2-core/{v4l2-async.c => v4l2-async-core.c} (96%)
> > > > 
> > > [..]
> > > > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> > > > index bf49f83cb86f..26e12db0a4e8 100644
> > > > --- a/drivers/media/v4l2-core/Kconfig
> > > > +++ b/drivers/media/v4l2-core/Kconfig
> > > > @@ -62,13 +62,14 @@ config V4L2_FLASH_LED_CLASS
> > > >         tristate "V4L2 flash API for LED flash class devices"
> > > >         depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
> > > >         depends on LEDS_CLASS_FLASH
> > > > +       select V4L2_ASYNC
> > > >         help
> > > >           Say Y here to enable V4L2 flash API support for LED flash
> > > >           class drivers.
> > > >  
> > > >           When in doubt, say N.
> > > >  
> > > > -config V4L2_FWNODE
> > > > +config V4L2_ASYNC
> > > >         tristate
> > > >  
> > > 
> > > So we don't expect (or want) out-of-tree drivers to be able to use this.
> > > Is that correct?
> > 
> > Hmm. I somehow manage to miss how this is related to out-of-tree drivers.
> > 
> 
> As it is, the v4l2-async module is not user-selectable, because
> V4L2_ASYNC has no prompt (the symbol is non-visible).
> 
> For the user to be able to select the v4l2-async module,
> even if no driver is selecting it, it needs a prompt: 
> 
> config V4L2_ASYNC
> 	tristate "V4L2 asynchronous subdevice support"

Well, yes, you could do this in principle.

But this patch does not change this in any way, does it?

> 
> This is usually useful for out-of-tree drivers, AFAIK.

If someone needs this out-of-tree, they could also enable one of the
drivers that need v4l2-async in the kernel.

-- 
Regards,

Sakari Ailus

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

* Re: [PATCH 1/1] v4l: async, fwnode: Improve module organisation
  2021-03-08 10:02 [PATCH 1/1] v4l: async, fwnode: Improve module organisation Sakari Ailus
@ 2021-03-10  4:15   ` kernel test robot
  2021-03-10  4:15   ` kernel test robot
  1 sibling, 0 replies; 9+ messages in thread
From: kernel test robot @ 2021-03-10  4:15 UTC (permalink / raw
  To: Sakari Ailus, linux-media; +Cc: kbuild-all, ezequiel

[-- Attachment #1: Type: text/plain, Size: 10095 bytes --]

Hi Sakari,

I love your patch! Yet something to improve:

[auto build test ERROR on v5.12-rc2]
[cannot apply to linuxtv-media/master tegra/for-next next-20210309]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Sakari-Ailus/v4l-async-fwnode-Improve-module-organisation/20210308-180511
base:    a38fd8748464831584a19438cbb3082b5a2dab15
config: x86_64-randconfig-a002-20200405 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/bc53c52b3ccb2fb944e8ffde8557129640fb2781
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Sakari-Ailus/v4l-async-fwnode-Improve-module-organisation/20210308-180511
        git checkout bc53c52b3ccb2fb944e8ffde8557129640fb2781
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   ld: warning: orphan section `.data..decrypted' from `arch/x86/kernel/cpu/vmware.o' being placed in section `.data..decrypted'
   ld: warning: orphan section `.data..decrypted' from `arch/x86/kernel/kvm.o' being placed in section `.data..decrypted'
   ld: drivers/media/i2c/adv7343.o: in function `adv7343_remove':
>> drivers/media/i2c/adv7343.c:500: undefined reference to `v4l2_async_unregister_subdev'
   ld: drivers/media/i2c/adv7343.o: in function `adv7343_probe':
>> drivers/media/i2c/adv7343.c:486: undefined reference to `v4l2_async_register_subdev'
   ld: drivers/media/i2c/max2175.o: in function `max2175_remove':
>> drivers/media/i2c/max2175.c:1413: undefined reference to `v4l2_async_unregister_subdev'
   ld: drivers/media/i2c/max2175.o: in function `max2175_probe':
>> drivers/media/i2c/max2175.c:1382: undefined reference to `v4l2_async_register_subdev'
>> ld: drivers/media/i2c/max2175.c:1400: undefined reference to `v4l2_async_unregister_subdev'


vim +500 drivers/media/i2c/adv7343.c

187d42d6da62aa drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-07-20  430  
e671499303e4c0 drivers/media/i2c/adv7343.c   Kieran Bingham 2019-07-10  431  static int adv7343_probe(struct i2c_client *client)
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  432  {
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  433  	struct adv7343_state *state;
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  434  	int err;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  435  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  436  	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  437  		return -ENODEV;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  438  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  439  	v4l_info(client, "chip found @ 0x%x (%s)\n",
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  440  			client->addr << 1, client->adapter->name);
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  441  
c7a857a09f1f00 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-01-03  442  	state = devm_kzalloc(&client->dev, sizeof(struct adv7343_state),
c7a857a09f1f00 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-01-03  443  			     GFP_KERNEL);
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  444  	if (state == NULL)
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  445  		return -ENOMEM;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  446  
0b302d88534f08 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-01-22  447  	/* Copy board specific information here */
187d42d6da62aa drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-07-20  448  	state->pdata = adv7343_get_pdata(client);
0b302d88534f08 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-01-22  449  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  450  	state->reg00	= 0x80;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  451  	state->reg01	= 0x00;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  452  	state->reg02	= 0x20;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  453  	state->reg35	= 0x00;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  454  	state->reg80	= ADV7343_SD_MODE_REG1_DEFAULT;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  455  	state->reg82	= ADV7343_SD_MODE_REG2_DEFAULT;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  456  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  457  	state->output = ADV7343_COMPOSITE_ID;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  458  	state->std = V4L2_STD_NTSC;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  459  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  460  	v4l2_i2c_subdev_init(&state->sd, client, &adv7343_ops);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  461  
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  462  	v4l2_ctrl_handler_init(&state->hdl, 2);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  463  	v4l2_ctrl_new_std(&state->hdl, &adv7343_ctrl_ops,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  464  			V4L2_CID_BRIGHTNESS, ADV7343_BRIGHTNESS_MIN,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  465  					     ADV7343_BRIGHTNESS_MAX, 1,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  466  					     ADV7343_BRIGHTNESS_DEF);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  467  	v4l2_ctrl_new_std(&state->hdl, &adv7343_ctrl_ops,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  468  			V4L2_CID_HUE, ADV7343_HUE_MIN,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  469  				      ADV7343_HUE_MAX, 1,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  470  				      ADV7343_HUE_DEF);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  471  	v4l2_ctrl_new_std(&state->hdl, &adv7343_ctrl_ops,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  472  			V4L2_CID_GAIN, ADV7343_GAIN_MIN,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  473  				       ADV7343_GAIN_MAX, 1,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  474  				       ADV7343_GAIN_DEF);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  475  	state->sd.ctrl_handler = &state->hdl;
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  476  	if (state->hdl.error) {
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  477  		err = state->hdl.error;
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  478  		goto done;
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  479  	}
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  480  	v4l2_ctrl_handler_setup(&state->hdl);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  481  
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  482  	err = adv7343_initialize(&state->sd);
c7a857a09f1f00 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-01-03  483  	if (err)
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  484  		goto done;
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  485  
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22 @486  	err = v4l2_async_register_subdev(&state->sd);
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  487  
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  488  done:
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  489  	if (err < 0)
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  490  		v4l2_ctrl_handler_free(&state->hdl);
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  491  
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  492  	return err;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  493  }
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  494  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  495  static int adv7343_remove(struct i2c_client *client)
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  496  {
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  497  	struct v4l2_subdev *sd = i2c_get_clientdata(client);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  498  	struct adv7343_state *state = to_state(sd);
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  499  
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22 @500  	v4l2_async_unregister_subdev(&state->sd);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  501  	v4l2_ctrl_handler_free(&state->hdl);
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  502  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  503  	return 0;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  504  }
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  505  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34770 bytes --]

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

* Re: [PATCH 1/1] v4l: async, fwnode: Improve module organisation
@ 2021-03-10  4:15   ` kernel test robot
  0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2021-03-10  4:15 UTC (permalink / raw
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 10219 bytes --]

Hi Sakari,

I love your patch! Yet something to improve:

[auto build test ERROR on v5.12-rc2]
[cannot apply to linuxtv-media/master tegra/for-next next-20210309]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Sakari-Ailus/v4l-async-fwnode-Improve-module-organisation/20210308-180511
base:    a38fd8748464831584a19438cbb3082b5a2dab15
config: x86_64-randconfig-a002-20200405 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/bc53c52b3ccb2fb944e8ffde8557129640fb2781
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Sakari-Ailus/v4l-async-fwnode-Improve-module-organisation/20210308-180511
        git checkout bc53c52b3ccb2fb944e8ffde8557129640fb2781
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   ld: warning: orphan section `.data..decrypted' from `arch/x86/kernel/cpu/vmware.o' being placed in section `.data..decrypted'
   ld: warning: orphan section `.data..decrypted' from `arch/x86/kernel/kvm.o' being placed in section `.data..decrypted'
   ld: drivers/media/i2c/adv7343.o: in function `adv7343_remove':
>> drivers/media/i2c/adv7343.c:500: undefined reference to `v4l2_async_unregister_subdev'
   ld: drivers/media/i2c/adv7343.o: in function `adv7343_probe':
>> drivers/media/i2c/adv7343.c:486: undefined reference to `v4l2_async_register_subdev'
   ld: drivers/media/i2c/max2175.o: in function `max2175_remove':
>> drivers/media/i2c/max2175.c:1413: undefined reference to `v4l2_async_unregister_subdev'
   ld: drivers/media/i2c/max2175.o: in function `max2175_probe':
>> drivers/media/i2c/max2175.c:1382: undefined reference to `v4l2_async_register_subdev'
>> ld: drivers/media/i2c/max2175.c:1400: undefined reference to `v4l2_async_unregister_subdev'


vim +500 drivers/media/i2c/adv7343.c

187d42d6da62aa drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-07-20  430  
e671499303e4c0 drivers/media/i2c/adv7343.c   Kieran Bingham 2019-07-10  431  static int adv7343_probe(struct i2c_client *client)
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  432  {
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  433  	struct adv7343_state *state;
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  434  	int err;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  435  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  436  	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  437  		return -ENODEV;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  438  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  439  	v4l_info(client, "chip found @ 0x%x (%s)\n",
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  440  			client->addr << 1, client->adapter->name);
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  441  
c7a857a09f1f00 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-01-03  442  	state = devm_kzalloc(&client->dev, sizeof(struct adv7343_state),
c7a857a09f1f00 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-01-03  443  			     GFP_KERNEL);
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  444  	if (state == NULL)
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  445  		return -ENOMEM;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  446  
0b302d88534f08 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-01-22  447  	/* Copy board specific information here */
187d42d6da62aa drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-07-20  448  	state->pdata = adv7343_get_pdata(client);
0b302d88534f08 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-01-22  449  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  450  	state->reg00	= 0x80;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  451  	state->reg01	= 0x00;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  452  	state->reg02	= 0x20;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  453  	state->reg35	= 0x00;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  454  	state->reg80	= ADV7343_SD_MODE_REG1_DEFAULT;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  455  	state->reg82	= ADV7343_SD_MODE_REG2_DEFAULT;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  456  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  457  	state->output = ADV7343_COMPOSITE_ID;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  458  	state->std = V4L2_STD_NTSC;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  459  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  460  	v4l2_i2c_subdev_init(&state->sd, client, &adv7343_ops);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  461  
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  462  	v4l2_ctrl_handler_init(&state->hdl, 2);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  463  	v4l2_ctrl_new_std(&state->hdl, &adv7343_ctrl_ops,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  464  			V4L2_CID_BRIGHTNESS, ADV7343_BRIGHTNESS_MIN,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  465  					     ADV7343_BRIGHTNESS_MAX, 1,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  466  					     ADV7343_BRIGHTNESS_DEF);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  467  	v4l2_ctrl_new_std(&state->hdl, &adv7343_ctrl_ops,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  468  			V4L2_CID_HUE, ADV7343_HUE_MIN,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  469  				      ADV7343_HUE_MAX, 1,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  470  				      ADV7343_HUE_DEF);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  471  	v4l2_ctrl_new_std(&state->hdl, &adv7343_ctrl_ops,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  472  			V4L2_CID_GAIN, ADV7343_GAIN_MIN,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  473  				       ADV7343_GAIN_MAX, 1,
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  474  				       ADV7343_GAIN_DEF);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  475  	state->sd.ctrl_handler = &state->hdl;
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  476  	if (state->hdl.error) {
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  477  		err = state->hdl.error;
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  478  		goto done;
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  479  	}
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  480  	v4l2_ctrl_handler_setup(&state->hdl);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  481  
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  482  	err = adv7343_initialize(&state->sd);
c7a857a09f1f00 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-01-03  483  	if (err)
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  484  		goto done;
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  485  
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22 @486  	err = v4l2_async_register_subdev(&state->sd);
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  487  
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  488  done:
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  489  	if (err < 0)
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  490  		v4l2_ctrl_handler_free(&state->hdl);
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22  491  
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  492  	return err;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  493  }
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  494  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  495  static int adv7343_remove(struct i2c_client *client)
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  496  {
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  497  	struct v4l2_subdev *sd = i2c_get_clientdata(client);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  498  	struct adv7343_state *state = to_state(sd);
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  499  
6555cfc5e7f808 drivers/media/i2c/adv7343.c   Lad, Prabhakar 2013-06-22 @500  	v4l2_async_unregister_subdev(&state->sd);
ceed52d67e1cf7 drivers/media/video/adv7343.c Hans Verkuil   2010-12-12  501  	v4l2_ctrl_handler_free(&state->hdl);
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  502  
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  503  	return 0;
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  504  }
06e61f8d5f5df6 drivers/media/video/adv7343.c Chaithrika U S 2009-05-07  505  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34770 bytes --]

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

* Re: [PATCH 1/1] v4l: async, fwnode: Improve module organisation
  2021-03-09 22:21       ` Sakari Ailus
@ 2021-03-12 14:50         ` Ezequiel Garcia
  2021-03-12 16:40           ` Sakari Ailus
  0 siblings, 1 reply; 9+ messages in thread
From: Ezequiel Garcia @ 2021-03-12 14:50 UTC (permalink / raw
  To: Sakari Ailus; +Cc: linux-media

Hi Sakari,

Just saw the v2 and remembered I didn't follow-up
on your questions here. Sorry about that.

On Wed, 2021-03-10 at 00:21 +0200, Sakari Ailus wrote:
> Hi Ezequiel,
> 
> On Tue, Mar 09, 2021 at 09:22:16AM -0300, Ezequiel Garcia wrote:
> > On Tue, 2021-03-09 at 12:03 +0200, Sakari Ailus wrote:
> > > Hi Ezequiel,
> > > 
> > > On Mon, Mar 08, 2021 at 04:01:58PM -0300, Ezequiel Garcia wrote:
> > > > Hi Sakari,
> > > > 
> > > > Thanks a lot for the patch. I like where this is going.
> > > 
> > > Thanks for the review, too!
> > > 
> > > > 
> > > > On Mon, 2021-03-08 at 12:02 +0200, Sakari Ailus wrote:
> > > > > The V4L2 async framework is generally used with the V4L2 fwnode, which
> > > > > also depends on the former. There is only one exception, the CAFE_CCIC
> > > > > driver, which uses V4L2 async but does not need V4L2 fwnode.
> > > > > 
> > > > > At the same time there is a vast number of systems that need videodev
> > > > > module, but have no use for v4l2-async that's now part of videodev.
> > > > > 
> > > > > In order to improve, build v4l2-async and v4l2-fwnode as a single module
> > > > > called v4l2-async (the v4l2-async.c file is renamed as v4l2-async-core.c).
> > > > > Also the menu item V4L2_FWNODE is renamed as V4L2_ASYNC.
> > > > > 
> > > > > This also moves the initialisation of the debufs entries for async subdevs
> > > > > to loading of the v4l2-async module. The directory is named as
> > > > > "v4l2-async".
> > > > > 
> > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > > > > ---
> > > > > This goes on top of my recent async patches.
> > > > > 
> > > > >  drivers/media/i2c/Kconfig                     | 80 +++++++++----------
> > > > >  drivers/media/i2c/ccs/Kconfig                 |  2 +-
> > > > >  drivers/media/i2c/et8ek8/Kconfig              |  2 +-
> > > > >  drivers/media/pci/intel/ipu3/Kconfig          |  2 +-
> > > > >  drivers/media/platform/Kconfig                | 16 ++--
> > > > >  drivers/media/platform/am437x/Kconfig         |  2 +-
> > > > >  drivers/media/platform/atmel/Kconfig          |  4 +-
> > > > >  drivers/media/platform/cadence/Kconfig        |  4 +-
> > > > >  drivers/media/platform/davinci/Kconfig        |  2 +-
> > > > >  drivers/media/platform/exynos4-is/Kconfig     |  4 +-
> > > > >  drivers/media/platform/marvell-ccic/Kconfig   |  1 +
> > > > >  drivers/media/platform/rcar-vin/Kconfig       |  4 +-
> > > > >  .../media/platform/sunxi/sun4i-csi/Kconfig    |  2 +-
> > > > >  .../media/platform/sunxi/sun6i-csi/Kconfig    |  2 +-
> > > > >  drivers/media/platform/xilinx/Kconfig         |  2 +-
> > > > >  drivers/media/v4l2-core/Kconfig               |  3 +-
> > > > >  drivers/media/v4l2-core/Makefile              |  6 +-
> > > > >  .../{v4l2-async.c => v4l2-async-core.c}       | 23 +++++-
> > > > >  drivers/media/v4l2-core/v4l2-dev.c            |  5 --
> > > > >  drivers/staging/media/imx/Kconfig             |  2 +-
> > > > >  drivers/staging/media/tegra-video/Kconfig     |  2 +-
> > > > >  21 files changed, 94 insertions(+), 76 deletions(-)
> > > > >  rename drivers/media/v4l2-core/{v4l2-async.c => v4l2-async-core.c} (96%)
> > > > > 
> > > > [..]
> > > > > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> > > > > index bf49f83cb86f..26e12db0a4e8 100644
> > > > > --- a/drivers/media/v4l2-core/Kconfig
> > > > > +++ b/drivers/media/v4l2-core/Kconfig
> > > > > @@ -62,13 +62,14 @@ config V4L2_FLASH_LED_CLASS
> > > > >         tristate "V4L2 flash API for LED flash class devices"
> > > > >         depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
> > > > >         depends on LEDS_CLASS_FLASH
> > > > > +       select V4L2_ASYNC
> > > > >         help
> > > > >           Say Y here to enable V4L2 flash API support for LED flash
> > > > >           class drivers.
> > > > >  
> > > > >           When in doubt, say N.
> > > > >  
> > > > > -config V4L2_FWNODE
> > > > > +config V4L2_ASYNC
> > > > >         tristate
> > > > >  
> > > > 
> > > > So we don't expect (or want) out-of-tree drivers to be able to use this.
> > > > Is that correct?
> > > 
> > > Hmm. I somehow manage to miss how this is related to out-of-tree drivers.
> > > 
> > 
> > As it is, the v4l2-async module is not user-selectable, because
> > V4L2_ASYNC has no prompt (the symbol is non-visible).
> > 
> > For the user to be able to select the v4l2-async module,
> > even if no driver is selecting it, it needs a prompt: 
> > 
> > config V4L2_ASYNC
> >         tristate "V4L2 asynchronous subdevice support"
> 
> Well, yes, you could do this in principle.
> 
> But this patch does not change this in any way, does it?
> 

I can be wrong, but it does change it. Before the patch,
v4l2-async kernel API is in the videodev module, which
is built with CONFIG_VIDEO_V4L2, which is enabled
when the user selects CONFIG_MEDIA_SUPPORT.

If the kernel was built with CONFIG_VIDEO_V4L2,
out-of-tree drivers gets support for v4l2-async.

After this patch, the v4l2-async kernel API is now selected
by drivers that need it, and can't be enabled. If there are
no such drivers, out-of-tree drivers won't get it.

I guess this is a bit subtle, and perhaps not worth
considering.

> > 
> > This is usually useful for out-of-tree drivers, AFAIK.
> 
> If someone needs this out-of-tree, they could also enable one of the
> drivers that need v4l2-async in the kernel.
> 

True :)

Thanks,
Ezequiel


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

* Re: [PATCH 1/1] v4l: async, fwnode: Improve module organisation
  2021-03-12 14:50         ` Ezequiel Garcia
@ 2021-03-12 16:40           ` Sakari Ailus
  0 siblings, 0 replies; 9+ messages in thread
From: Sakari Ailus @ 2021-03-12 16:40 UTC (permalink / raw
  To: Ezequiel Garcia; +Cc: linux-media

Hi Ezequiel,

On Fri, Mar 12, 2021 at 11:50:35AM -0300, Ezequiel Garcia wrote:
> Hi Sakari,
> 
> Just saw the v2 and remembered I didn't follow-up
> on your questions here. Sorry about that.
> 
> On Wed, 2021-03-10 at 00:21 +0200, Sakari Ailus wrote:
> > Hi Ezequiel,
> > 
> > On Tue, Mar 09, 2021 at 09:22:16AM -0300, Ezequiel Garcia wrote:
> > > On Tue, 2021-03-09 at 12:03 +0200, Sakari Ailus wrote:
> > > > Hi Ezequiel,
> > > > 
> > > > On Mon, Mar 08, 2021 at 04:01:58PM -0300, Ezequiel Garcia wrote:
> > > > > Hi Sakari,
> > > > > 
> > > > > Thanks a lot for the patch. I like where this is going.
> > > > 
> > > > Thanks for the review, too!
> > > > 
> > > > > 
> > > > > On Mon, 2021-03-08 at 12:02 +0200, Sakari Ailus wrote:
> > > > > > The V4L2 async framework is generally used with the V4L2 fwnode, which
> > > > > > also depends on the former. There is only one exception, the CAFE_CCIC
> > > > > > driver, which uses V4L2 async but does not need V4L2 fwnode.
> > > > > > 
> > > > > > At the same time there is a vast number of systems that need videodev
> > > > > > module, but have no use for v4l2-async that's now part of videodev.
> > > > > > 
> > > > > > In order to improve, build v4l2-async and v4l2-fwnode as a single module
> > > > > > called v4l2-async (the v4l2-async.c file is renamed as v4l2-async-core.c).
> > > > > > Also the menu item V4L2_FWNODE is renamed as V4L2_ASYNC.
> > > > > > 
> > > > > > This also moves the initialisation of the debufs entries for async subdevs
> > > > > > to loading of the v4l2-async module. The directory is named as
> > > > > > "v4l2-async".
> > > > > > 
> > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > > > > > ---
> > > > > > This goes on top of my recent async patches.
> > > > > > 
> > > > > >  drivers/media/i2c/Kconfig                     | 80 +++++++++----------
> > > > > >  drivers/media/i2c/ccs/Kconfig                 |  2 +-
> > > > > >  drivers/media/i2c/et8ek8/Kconfig              |  2 +-
> > > > > >  drivers/media/pci/intel/ipu3/Kconfig          |  2 +-
> > > > > >  drivers/media/platform/Kconfig                | 16 ++--
> > > > > >  drivers/media/platform/am437x/Kconfig         |  2 +-
> > > > > >  drivers/media/platform/atmel/Kconfig          |  4 +-
> > > > > >  drivers/media/platform/cadence/Kconfig        |  4 +-
> > > > > >  drivers/media/platform/davinci/Kconfig        |  2 +-
> > > > > >  drivers/media/platform/exynos4-is/Kconfig     |  4 +-
> > > > > >  drivers/media/platform/marvell-ccic/Kconfig   |  1 +
> > > > > >  drivers/media/platform/rcar-vin/Kconfig       |  4 +-
> > > > > >  .../media/platform/sunxi/sun4i-csi/Kconfig    |  2 +-
> > > > > >  .../media/platform/sunxi/sun6i-csi/Kconfig    |  2 +-
> > > > > >  drivers/media/platform/xilinx/Kconfig         |  2 +-
> > > > > >  drivers/media/v4l2-core/Kconfig               |  3 +-
> > > > > >  drivers/media/v4l2-core/Makefile              |  6 +-
> > > > > >  .../{v4l2-async.c => v4l2-async-core.c}       | 23 +++++-
> > > > > >  drivers/media/v4l2-core/v4l2-dev.c            |  5 --
> > > > > >  drivers/staging/media/imx/Kconfig             |  2 +-
> > > > > >  drivers/staging/media/tegra-video/Kconfig     |  2 +-
> > > > > >  21 files changed, 94 insertions(+), 76 deletions(-)
> > > > > >  rename drivers/media/v4l2-core/{v4l2-async.c => v4l2-async-core.c} (96%)
> > > > > > 
> > > > > [..]
> > > > > > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> > > > > > index bf49f83cb86f..26e12db0a4e8 100644
> > > > > > --- a/drivers/media/v4l2-core/Kconfig
> > > > > > +++ b/drivers/media/v4l2-core/Kconfig
> > > > > > @@ -62,13 +62,14 @@ config V4L2_FLASH_LED_CLASS
> > > > > >         tristate "V4L2 flash API for LED flash class devices"
> > > > > >         depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
> > > > > >         depends on LEDS_CLASS_FLASH
> > > > > > +       select V4L2_ASYNC
> > > > > >         help
> > > > > >           Say Y here to enable V4L2 flash API support for LED flash
> > > > > >           class drivers.
> > > > > >  
> > > > > >           When in doubt, say N.
> > > > > >  
> > > > > > -config V4L2_FWNODE
> > > > > > +config V4L2_ASYNC
> > > > > >         tristate
> > > > > >  
> > > > > 
> > > > > So we don't expect (or want) out-of-tree drivers to be able to use this.
> > > > > Is that correct?
> > > > 
> > > > Hmm. I somehow manage to miss how this is related to out-of-tree drivers.
> > > > 
> > > 
> > > As it is, the v4l2-async module is not user-selectable, because
> > > V4L2_ASYNC has no prompt (the symbol is non-visible).
> > > 
> > > For the user to be able to select the v4l2-async module,
> > > even if no driver is selecting it, it needs a prompt: 
> > > 
> > > config V4L2_ASYNC
> > >         tristate "V4L2 asynchronous subdevice support"
> > 
> > Well, yes, you could do this in principle.
> > 
> > But this patch does not change this in any way, does it?
> > 
> 
> I can be wrong, but it does change it. Before the patch,
> v4l2-async kernel API is in the videodev module, which
> is built with CONFIG_VIDEO_V4L2, which is enabled
> when the user selects CONFIG_MEDIA_SUPPORT.
> 
> If the kernel was built with CONFIG_VIDEO_V4L2,
> out-of-tree drivers gets support for v4l2-async.
> 
> After this patch, the v4l2-async kernel API is now selected
> by drivers that need it, and can't be enabled. If there are
> no such drivers, out-of-tree drivers won't get it.

Yes, this is true with V4L2_ASYNC but it was true for V4L2_FWNODE
previously, too. 

> I guess this is a bit subtle, and perhaps not worth
> considering.

I'm not sure how common proper out-of-tree drivers are anyway, most live in
some random kernel tree that contains a bunch of non-upstreamed stuff.

> > If someone needs this out-of-tree, they could also enable one of the
> > drivers that need v4l2-async in the kernel.
> > 
> 
> True :)

\o/

-- 
Regards,

Sakari Ailus

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

end of thread, other threads:[~2021-03-12 16:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-08 10:02 [PATCH 1/1] v4l: async, fwnode: Improve module organisation Sakari Ailus
2021-03-08 19:01 ` Ezequiel Garcia
2021-03-09 10:03   ` Sakari Ailus
2021-03-09 12:22     ` Ezequiel Garcia
2021-03-09 22:21       ` Sakari Ailus
2021-03-12 14:50         ` Ezequiel Garcia
2021-03-12 16:40           ` Sakari Ailus
2021-03-10  4:15 ` kernel test robot
2021-03-10  4:15   ` kernel test robot

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.