Skip to contentSkip to conversation

Media Kconfig menu reorg and improvements

PATCH In review Mauro Carvalho Chehab 5 participants 41 messages Mar 31, 2020 – Apr 1, 2020

Subsystems (27)
lore
Share & tools
lore
#0 lore raw

v4 cover Media Kconfig menu reorg and improvements

The media Kconfig menu is complex. From time to time, it requires some improvements.

This series is organized on two parts:

1. Patches 1 to 19: cleanups and improvements;

- Try to be smarter when selecting features. So, auto-select Cypress firmware support on drivers that use it. Also, auto-select Media Controller and V4L2 subdevice API for devices that won't work without such features.

Please notice that some drivers have can work optionally with those features enabled (or not). For those, users should still explicitly enable such features.

- Platform and test drivers have now an option at the device support selection;

- The test drivers are not platform drivers. They deserve their own directory. When a test driver is selected, the needed API support will be automatically selected.

- Do some Kconfig reorg, in order to keep the main media Kconfig as clean as possible.

- The help messafe for media support was outdated;

- The ddbridge driver was abusing at the dvb dummy frontend driver (meant to be just an example). It will now have its own internal dummy driver, as the original one will soon receive more code and become a virtual driver.

- There's a longstanding issue with hybrid TV devices: for an hybrid device to work, *both* analog and digital TV would need to be selected. As the Kconfig language improved, we can now address it. So, selecting either analog or digital TV support should display all hybrid devices. When an hybrid driver is selected, both V4L2 and DVB core will be available.

2. Patches 20 to 33: visual changes.

- At the beginning, media had just "technical" options to enable/disable each feature. However, that leads into hundreds of different options, being a nightmare for a mortal to set it up.

So, the Kconfig menu options were re-designed in order to bring a more user-oriented view:

The initial items select the type of devices (analog TV, digital TV, cameras, ...). Selecting it would auto-select the core drivers. The next step would be to select either PCI or USB, and the needed driver.

While this makes life simpler, now there are many embedded developers. Most seem to prefer to be able of seeing everything without filters.

The main focus of this part is to make everybody
happy: it is now possible to unselect the filters, making all options visible. Also, now, when the filter is enabled, the media drivers menu will show a message warning that the filter is active.

Hopefully, this should make both embedded developers and normal users happy.

- The media menus now have a more modern visual, grouping options in a way that it is now clearer about what they do.

So, the Media support menu is now:

	--- Media support
	[ ] Filter media drivers
	[ ] Autoselect ancillary drivers
	    Media device types --->
	    Media core support --->
	    Video4Linux options --->
	    Media controller options --->
	    Digital TV options --->
	    HDMI CEC options --->
	    Media drivers --->
	    Media ancillary drivers --->

Mauro Carvalho Chehab (33):
media: dvb-usb: auto-select CYPRESS_FIRMWARE
media: Kconfig: add an option to filter in/out platform drivers
media: Kconfig: not all V4L2 platform drivers are for camera
media: pci: move VIDEO_PCI_SKELETON to a different Kconfig
media: Kconfig: update the MEDIA_SUPPORT help message
media: split test drivers from platform directory
media: Kconfig: move comment to siano include
media: Kconfig: move drivers-specific TTPCI_EEPROM Kconfig var
media: Kconfig: mode firewire comment to firewire/Kconfig
media: ddbridge: copy the dvb_dummy_fe driver to ddbridge
media: ddbridge-dummy_fe: do some vars and function renames
media: ddbridge: use the ddbridge's own dummy fe driver
media: Kconfig: mark other drivers as test drivers
media: Kconfig: simplify some dependencies
media: Kconfig: better support hybrid TV devices
media: Kconfig: fix selection for test drivers
media: add SPDX headers on Kconfig and Makefile files
media: dvb-core: Kconfig: default to use dynamic minors
media: Kconfig files: use select for V4L2 subdevs and MC
media: Kconfig: reorganize the drivers menu options
media: Kconfig: use a sub-menu to select supported devices
media: Kconfig: make filtering devices optional
media: Kconfig: warn if drivers are filtered
media: Kconfig: move CEC-specific options to cec/Kconfig
media: Kconfig: move DVB-specific options to dvb-core/Kconfig
media: Kconfig: move V4L2 subdev API to v4l2-core/Kconfig
media: Kconfig: move media controller core select to main Kconfig
media: Kconfig: place all options under a sub-menu
media: Kconfig: move the position of sub-driver autoselection
media: Kconfig: on !EMBEDDED && !EXPERT, enable driver filtering
media: Kconfig: Better organize the per-API options
media: i2c/Kconfig: reorganize items there
media: Kconfig: don't use visible for device type select

 drivers/media/Kconfig                         | 262 ++++++-----
 drivers/media/cec/Kconfig                     |  10 +
 drivers/media/common/Kconfig                  |   2 +-
 drivers/media/dvb-core/Kconfig                |  27 ++
 drivers/media/dvb-frontends/Kconfig           |  15 +-
 drivers/media/firewire/Kconfig                |   5 +-
 drivers/media/i2c/Kconfig                     | 406 +++++++++++-------
 drivers/media/i2c/et8ek8/Kconfig              |   4 +-
 drivers/media/i2c/m5mols/Kconfig              |   5 +-
 drivers/media/i2c/smiapp/Kconfig              |   5 +-
 drivers/media/mc/Kconfig                      |  11 +-
 drivers/media/mmc/Kconfig                     |   1 -
 drivers/media/mmc/siano/Kconfig               |   2 +
 drivers/media/pci/Kconfig                     |  24 +-
 drivers/media/pci/bt8xx/Kconfig               |   5 +-
 drivers/media/pci/cobalt/Kconfig              |   4 +-
 drivers/media/pci/cx18/Kconfig                |   2 +-
 drivers/media/pci/cx23885/Kconfig             |   4 +-
 drivers/media/pci/cx88/Kconfig                |   4 +-
 drivers/media/pci/ddbridge/Kconfig            |   1 -
 drivers/media/pci/ddbridge/Makefile           |   2 +-
 drivers/media/pci/ddbridge/ddbridge-core.c    |   4 +-
 .../media/pci/ddbridge/ddbridge-dummy-fe.c    | 153 +++++++
 .../media/pci/ddbridge/ddbridge-dummy-fe.h    |  16 +
 drivers/media/pci/intel/ipu3/Kconfig          |   4 +-
 drivers/media/pci/saa7134/Kconfig             |   4 +-
 drivers/media/pci/saa7164/Kconfig             |   2 +-
 drivers/media/pci/sta2x11/Kconfig             |   6 +-
 drivers/media/platform/Kconfig                |  56 +--
 drivers/media/platform/Makefile               |   5 -
 drivers/media/platform/am437x/Kconfig         |   4 +-
 drivers/media/platform/atmel/Kconfig          |   4 +-
 drivers/media/platform/cadence/Kconfig        |   8 +-
 drivers/media/platform/exynos4-is/Kconfig     |   5 +-
 drivers/media/platform/rcar-vin/Kconfig       |   8 +-
 drivers/media/platform/sunxi/Kconfig          |   2 +
 drivers/media/platform/sunxi/Makefile         |   2 +
 .../media/platform/sunxi/sun4i-csi/Kconfig    |   6 +-
 .../media/platform/sunxi/sun4i-csi/Makefile   |   2 +
 .../media/platform/sunxi/sun6i-csi/Kconfig    |   4 +-
 drivers/media/platform/xilinx/Kconfig         |   4 +-
 drivers/media/spi/Kconfig                     |   4 +-
 drivers/media/test_drivers/Kconfig            |  28 ++
 drivers/media/test_drivers/Makefile           |   9 +
 .../vicodec/Kconfig                           |   0
 .../vicodec/Makefile                          |   0
 .../vicodec/codec-fwht.c                      |   0
 .../vicodec/codec-fwht.h                      |   0
 .../vicodec/codec-v4l2-fwht.c                 |   0
 .../vicodec/codec-v4l2-fwht.h                 |   0
 .../vicodec/vicodec-core.c                    |   0
 .../media/{platform => test_drivers}/vim2m.c  |   0
 .../{platform => test_drivers}/vimc/Kconfig   |   4 +-
 .../{platform => test_drivers}/vimc/Makefile  |   0
 .../vimc/vimc-capture.c                       |   0
 .../vimc/vimc-common.c                        |   0
 .../vimc/vimc-common.h                        |   0
 .../vimc/vimc-core.c                          |   0
 .../vimc/vimc-debayer.c                       |   0
 .../vimc/vimc-scaler.c                        |   0
 .../vimc/vimc-sensor.c                        |   0
 .../vimc/vimc-streamer.c                      |   0
 .../vimc/vimc-streamer.h                      |   0
 .../{platform => test_drivers}/vivid/Kconfig  |   0
 .../{platform => test_drivers}/vivid/Makefile |   0
 .../vivid/vivid-cec.c                         |   0
 .../vivid/vivid-cec.h                         |   0
 .../vivid/vivid-core.c                        |   0
 .../vivid/vivid-core.h                        |   0
 .../vivid/vivid-ctrls.c                       |   0
 .../vivid/vivid-ctrls.h                       |   0
 .../vivid/vivid-kthread-cap.c                 |   0
 .../vivid/vivid-kthread-cap.h                 |   0
 .../vivid/vivid-kthread-out.c                 |   0
 .../vivid/vivid-kthread-out.h                 |   0
 .../vivid/vivid-kthread-touch.c               |   0
 .../vivid/vivid-kthread-touch.h               |   0
 .../vivid/vivid-meta-cap.c                    |   0
 .../vivid/vivid-meta-cap.h                    |   0
 .../vivid/vivid-meta-out.c                    |   0
 .../vivid/vivid-meta-out.h                    |   0
 .../vivid/vivid-osd.c                         |   0
 .../vivid/vivid-osd.h                         |   0
 .../vivid/vivid-radio-common.c                |   0
 .../vivid/vivid-radio-common.h                |   0
 .../vivid/vivid-radio-rx.c                    |   0
 .../vivid/vivid-radio-rx.h                    |   0
 .../vivid/vivid-radio-tx.c                    |   0
 .../vivid/vivid-radio-tx.h                    |   0
 .../vivid/vivid-rds-gen.c                     |   0
 .../vivid/vivid-rds-gen.h                     |   0
 .../vivid/vivid-sdr-cap.c                     |   0
 .../vivid/vivid-sdr-cap.h                     |   0
 .../vivid/vivid-touch-cap.c                   |   0
 .../vivid/vivid-touch-cap.h                   |   0
 .../vivid/vivid-vbi-cap.c                     |   0
 .../vivid/vivid-vbi-cap.h                     |   0
 .../vivid/vivid-vbi-gen.c                     |   0
 .../vivid/vivid-vbi-gen.h                     |   0
 .../vivid/vivid-vbi-out.c                     |   0
 .../vivid/vivid-vbi-out.h                     |   0
 .../vivid/vivid-vid-cap.c                     |   0
 .../vivid/vivid-vid-cap.h                     |   0
 .../vivid/vivid-vid-common.c                  |   0
 .../vivid/vivid-vid-common.h                  |   0
 .../vivid/vivid-vid-out.c                     |   0
 .../vivid/vivid-vid-out.h                     |   0
 drivers/media/usb/Kconfig                     |  14 +-
 drivers/media/usb/au0828/Kconfig              |   6 +-
 drivers/media/usb/cx231xx/Kconfig             |   4 +-
 drivers/media/usb/dvb-usb/Kconfig             |   1 +
 drivers/media/usb/pvrusb2/Kconfig             |   4 +-
 drivers/media/usb/tm6000/Kconfig              |   4 +-
 drivers/media/v4l2-core/Kconfig               |  19 +-
 drivers/staging/media/hantro/Kconfig          |   5 +-
 drivers/staging/media/hantro/Makefile         |   2 +
 drivers/staging/media/imx/Kconfig             |   5 +-
 drivers/staging/media/ipu3/Kconfig            |   3 +-
 drivers/staging/media/omap4iss/Kconfig        |   4 +-
 drivers/staging/media/rkisp1/Kconfig          |   4 +-
 drivers/staging/media/rkisp1/Makefile         |   2 +
 drivers/staging/media/sunxi/cedrus/Kconfig    |   5 +-
 122 files changed, 829 insertions(+), 398 deletions(-)
 create mode 100644 drivers/media/pci/ddbridge/ddbridge-dummy-fe.c
 create mode 100644 drivers/media/pci/ddbridge/ddbridge-dummy-fe.h
 create mode 100644 drivers/media/test_drivers/Kconfig
 create mode 100644 drivers/media/test_drivers/Makefile
 rename drivers/media/{platform => test_drivers}/vicodec/Kconfig (100%)
 rename drivers/media/{platform => test_drivers}/vicodec/Makefile (100%)
 rename drivers/media/{platform => test_drivers}/vicodec/codec-fwht.c (100%)
 rename drivers/media/{platform => test_drivers}/vicodec/codec-fwht.h (100%)
 rename drivers/media/{platform => test_drivers}/vicodec/codec-v4l2-fwht.c (100%)
 rename drivers/media/{platform => test_drivers}/vicodec/codec-v4l2-fwht.h (100%)
 rename drivers/media/{platform => test_drivers}/vicodec/vicodec-core.c (100%)
 rename drivers/media/{platform => test_drivers}/vim2m.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/Kconfig (83%)
 rename drivers/media/{platform => test_drivers}/vimc/Makefile (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-capture.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-common.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-common.h (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-core.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-debayer.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-scaler.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-sensor.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-streamer.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-streamer.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/Kconfig (100%)
 rename drivers/media/{platform => test_drivers}/vivid/Makefile (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-cec.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-cec.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-core.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-core.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-ctrls.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-ctrls.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-kthread-cap.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-kthread-cap.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-kthread-out.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-kthread-out.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-kthread-touch.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-kthread-touch.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-meta-cap.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-meta-cap.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-meta-out.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-meta-out.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-osd.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-osd.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-radio-common.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-radio-common.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-radio-rx.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-radio-rx.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-radio-tx.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-radio-tx.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-rds-gen.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-rds-gen.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-sdr-cap.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-sdr-cap.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-touch-cap.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-touch-cap.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vbi-cap.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vbi-cap.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vbi-gen.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vbi-gen.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vbi-out.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vbi-out.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vid-cap.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vid-cap.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vid-common.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vid-common.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vid-out.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vid-out.h (100%)
Signature · 1 line
2.25.1
#18 lore raw

PATCH v4 17/33 media: add SPDX headers on Kconfig and Makefile files

Most of media Kconfig/Makefile files already has SPDX, but there are a few ones still missing. Add it to them.

---
 drivers/media/dvb-frontends/Kconfig             | 2 ++
 drivers/media/mc/Kconfig                        | 2 ++
 drivers/media/platform/sunxi/Kconfig            | 2 ++
 drivers/media/platform/sunxi/Makefile           | 2 ++
 drivers/media/platform/sunxi/sun4i-csi/Kconfig  | 2 ++
 drivers/media/platform/sunxi/sun4i-csi/Makefile | 2 ++
 drivers/staging/media/hantro/Makefile           | 2 ++
 drivers/staging/media/rkisp1/Makefile           | 2 ++
 8 files changed, 16 insertions(+)
drivers/media/dvb-frontends/Kconfig +2 -0
index 1f45808d94da..aa24506257b3 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 if MEDIA_DIGITAL_TV_SUPPORT
 
 comment "DVB Frontend drivers hidden by 'Autoselect ancillary drivers'"
drivers/media/mc/Kconfig +2 -0
index 3b9795cfcb36..0c5c52f14c64 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 #
 # Media controller
 #	Selectable only for webcam/grabbers, as other drivers don't use it
drivers/media/platform/sunxi/Kconfig +2 -0
index 71808e93ac2e..7151cc249afa 100644
@@ -1,2 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+
 source "drivers/media/platform/sunxi/sun4i-csi/Kconfig"
 source "drivers/media/platform/sunxi/sun6i-csi/Kconfig"
drivers/media/platform/sunxi/Makefile +2 -0
index ff0993f70dc3..fc537c9f5ca9 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 obj-y		+= sun4i-csi/
 obj-y		+= sun6i-csi/
 obj-y		+= sun8i-di/
drivers/media/platform/sunxi/sun4i-csi/Kconfig +2 -0
index e86e29b6a603..93b4e82a2655 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 config VIDEO_SUN4I_CSI
 	tristate "Allwinner A10 CMOS Sensor Interface Support"
 	depends on VIDEO_V4L2 && COMMON_CLK && VIDEO_V4L2_SUBDEV_API && HAS_DMA
drivers/media/platform/sunxi/sun4i-csi/Makefile +2 -0
index 7c790a57f5ee..5062b006d63e 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 sun4i-csi-y += sun4i_csi.o
 sun4i-csi-y += sun4i_dma.o
 sun4i-csi-y += sun4i_v4l2.o
drivers/staging/media/hantro/Makefile +2 -0
index 68c29a9c4946..743ce08eb184 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 obj-$(CONFIG_VIDEO_HANTRO) += hantro-vpu.o
 
 hantro-vpu-y += \
drivers/staging/media/rkisp1/Makefile +2 -0
index 69ca59c7ef34..ab32a77db8f7 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 obj-$(CONFIG_VIDEO_ROCKCHIP_ISP1) += rockchip-isp1.o
 rockchip-isp1-objs += 	rkisp1-capture.o \
 			rkisp1-common.o \
Signature · 1 line
2.25.1
#26 lore raw

PATCH v4 19/33 media: Kconfig files: use select for V4L2 subdevs and MC

In reply to Mauro Carvalho Chehab

There are lots of drivers that only work when the media controller and/or the V4L2 subdev APIs are present.

Right now, someone need to first enable those APIs before using those drivers.

Well, ideally, drivers, should, instead *optionally* depend on it, in order for PC camera drivers to be able to use them, but nowadays most drivers are UVC cameras, with don't require a sensor driver.

So, be it.

Let's instead make them select the MEDIA_CONTROLLER and the SUBDEV API, in order to make easier for people to be able of enabling them.

---
 drivers/media/i2c/Kconfig                     | 210 ++++++++++++------
 drivers/media/i2c/et8ek8/Kconfig              |   4 +-
 drivers/media/i2c/m5mols/Kconfig              |   5 +-
 drivers/media/i2c/smiapp/Kconfig              |   5 +-
 drivers/media/mc/Kconfig                      |   2 +-
 drivers/media/pci/cobalt/Kconfig              |   4 +-
 drivers/media/pci/intel/ipu3/Kconfig          |   4 +-
 drivers/media/pci/sta2x11/Kconfig             |   6 +-
 drivers/media/platform/Kconfig                |  28 ++-
 drivers/media/platform/am437x/Kconfig         |   4 +-
 drivers/media/platform/atmel/Kconfig          |   4 +-
 drivers/media/platform/cadence/Kconfig        |   8 +-
 drivers/media/platform/exynos4-is/Kconfig     |   5 +-
 drivers/media/platform/rcar-vin/Kconfig       |   8 +-
 .../media/platform/sunxi/sun4i-csi/Kconfig    |   4 +-
 .../media/platform/sunxi/sun6i-csi/Kconfig    |   4 +-
 drivers/media/platform/xilinx/Kconfig         |   4 +-
 drivers/media/spi/Kconfig                     |   4 +-
 drivers/media/test_drivers/vimc/Kconfig       |   4 +-
 drivers/staging/media/hantro/Kconfig          |   5 +-
 drivers/staging/media/imx/Kconfig             |   5 +-
 drivers/staging/media/ipu3/Kconfig            |   3 +-
 drivers/staging/media/omap4iss/Kconfig        |   4 +-
 drivers/staging/media/rkisp1/Kconfig          |   4 +-
 drivers/staging/media/sunxi/cedrus/Kconfig    |   5 +-
 25 files changed, 237 insertions(+), 106 deletions(-)
drivers/media/i2c/Kconfig +148 -62
index 125d596c13dd..4bc4cfea2f20 100644
@@ -19,7 +19,7 @@ config VIDEO_IR_I2C
 	  In doubt, say Y.
 
 #
-# Encoder / Decoder module configuration
+# V4L2 I2C drivers that aren't related with Camera support
 #
 
 comment "I2C drivers hidden by 'Autoselect ancillary drivers'"
@@ -28,6 +28,10 @@ comment "I2C drivers hidden by 'Autoselect ancillary drivers'"
 menu "I2C Encoders, decoders, sensors and other helper chips"
 	visible if !MEDIA_HIDE_ANCILLARY_SUBDRV
 
+#
+# Encoder / Decoder module configuration
+#
+
 comment "Audio decoders, processors and mixers"
 
 config VIDEO_TVAUDIO
@@ -62,11 +66,13 @@ config VIDEO_TDA9840
 
 config VIDEO_TDA1997X
 	tristate "NXP TDA1997x HDMI receiver"
-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2 && I2C
 	depends on SND_SOC
 	select HDMI
 	select SND_PCM
 	select V4L2_FWNODE
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  V4L2 subdevice driver for the NXP TDA1997x HDMI receivers.
 
@@ -204,7 +210,9 @@ comment "Video decoders"
 
 config VIDEO_ADV7180
 	tristate "Analog Devices ADV7180 decoder"
-	depends on GPIOLIB && VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	depends on GPIOLIB && VIDEO_V4L2 && I2C
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  Support for the Analog Devices ADV7180 video decoder.
 
@@ -223,8 +231,10 @@ config VIDEO_ADV7183
 
 config VIDEO_ADV748X
 	tristate "Analog Devices ADV748x decoder"
-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2 && I2C
 	depends on OF
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP_I2C
 	select V4L2_FWNODE
 	help
@@ -236,8 +246,10 @@ config VIDEO_ADV748X
 
 config VIDEO_ADV7604
 	tristate "Analog Devices ADV7604 decoder"
-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2 && I2C
 	depends on GPIOLIB || COMPILE_TEST
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP_I2C
 	select HDMI
 	select V4L2_FWNODE
@@ -260,7 +272,9 @@ config VIDEO_ADV7604_CEC
 
 config VIDEO_ADV7842
 	tristate "Analog Devices ADV7842 decoder"
-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2 && I2C
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select HDMI
 	help
 	  Support for the Analog Devices ADV7842 video decoder.
@@ -347,7 +361,9 @@ config VIDEO_SAA711X
 
 config VIDEO_TC358743
 	tristate "Toshiba TC358743 decoder"
-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2 && I2C
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select HDMI
 	select V4L2_FWNODE
 	help
@@ -515,8 +531,10 @@ config VIDEO_ADV7393
 
 config VIDEO_ADV7511
 	tristate "Analog Devices ADV7511 encoder"
-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2 && I2C
 	depends on DRM_I2C_ADV7511=n || COMPILE_TEST
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select HDMI
 	help
 	  Support for the Analog Devices ADV7511 video encoder.
@@ -536,7 +554,10 @@ config VIDEO_ADV7511_CEC
 
 config VIDEO_AD9389B
 	tristate "Analog Devices AD9389B encoder"
-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2 && I2C
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
+
 	help
 	  Support for the Analog Devices AD9389B video encoder.
 
@@ -568,12 +589,17 @@ config VIDEO_APTINA_PLL
 config VIDEO_SMIAPP_PLL
 	tristate
 
+#
+# All drivers that are related to Media Camera Support should be here
+#
+
 if MEDIA_CAMERA_SUPPORT
 
 config VIDEO_HI556
 	tristate "Hynix Hi-556 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
-	depends on MEDIA_CONTROLLER
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a Video4Linux2 sensor driver for the Hynix
@@ -584,8 +610,10 @@ config VIDEO_HI556
 
 config VIDEO_IMX214
 	tristate "Sony IMX214 sensor support"
-	depends on GPIOLIB && I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on GPIOLIB && I2C && VIDEO_V4L2
 	depends on V4L2_FWNODE
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP_I2C
 	help
 	  This is a Video4Linux2 sensor driver for the Sony
@@ -596,7 +624,9 @@ config VIDEO_IMX214
 
 config VIDEO_IMX219
 	tristate "Sony IMX219 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a Video4Linux2 sensor driver for the Sony
@@ -607,7 +637,9 @@ config VIDEO_IMX219
 
 config VIDEO_IMX258
 	tristate "Sony IMX258 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  This is a Video4Linux2 sensor driver for the Sony
 	  IMX258 camera.
@@ -617,7 +649,9 @@ config VIDEO_IMX258
 
 config VIDEO_IMX274
 	tristate "Sony IMX274 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP_I2C
 	help
 	  This is a V4L2 sensor driver for the Sony IMX274
@@ -625,7 +659,9 @@ config VIDEO_IMX274
 
 config VIDEO_IMX290
 	tristate "Sony IMX290 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP_I2C
 	select V4L2_FWNODE
 	help
@@ -637,7 +673,9 @@ config VIDEO_IMX290
 
 config VIDEO_IMX319
 	tristate "Sony IMX319 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  This is a Video4Linux2 sensor driver for the Sony
 	  IMX319 camera.
@@ -647,7 +685,9 @@ config VIDEO_IMX319
 
 config VIDEO_IMX355
 	tristate "Sony IMX355 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  This is a Video4Linux2 sensor driver for the Sony
 	  IMX355 camera.
@@ -678,7 +718,8 @@ config VIDEO_OV2659
 
 config VIDEO_OV2680
 	tristate "OmniVision OV2680 sensor support"
-	depends on VIDEO_V4L2 && I2C && MEDIA_CONTROLLER
+	depends on VIDEO_V4L2 && I2C
+	select MEDIA_CONTROLLER
 	select V4L2_FWNODE
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
@@ -689,7 +730,8 @@ config VIDEO_OV2680
 
 config VIDEO_OV2685
 	tristate "OmniVision OV2685 sensor support"
-	depends on VIDEO_V4L2 && I2C && MEDIA_CONTROLLER
+	depends on VIDEO_V4L2 && I2C
+	select MEDIA_CONTROLLER
 	select V4L2_FWNODE
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
@@ -701,7 +743,9 @@ config VIDEO_OV2685
 config VIDEO_OV5640
 	tristate "OmniVision OV5640 sensor support"
 	depends on OF
-	depends on GPIOLIB && VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	depends on GPIOLIB && VIDEO_V4L2 && I2C
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a Video4Linux2 sensor driver for the Omnivision
@@ -710,7 +754,9 @@ config VIDEO_OV5640
 config VIDEO_OV5645
 	tristate "OmniVision OV5645 sensor support"
 	depends on OF
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
@@ -721,7 +767,9 @@ config VIDEO_OV5645
 
 config VIDEO_OV5647
 	tristate "OmniVision OV5647 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
@@ -742,8 +790,9 @@ config VIDEO_OV6650
 
 config VIDEO_OV5670
 	tristate "OmniVision OV5670 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
-	depends on MEDIA_CONTROLLER
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
@@ -754,8 +803,9 @@ config VIDEO_OV5670
 
 config VIDEO_OV5675
 	tristate "OmniVision OV5675 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
-	depends on MEDIA_CONTROLLER
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
@@ -777,7 +827,9 @@ config VIDEO_OV5695
 
 config VIDEO_OV7251
 	tristate "OmniVision OV7251 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
@@ -826,7 +878,9 @@ config VIDEO_OV7740
 
 config VIDEO_OV8856
 	tristate "OmniVision OV8856 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
@@ -844,7 +898,9 @@ config VIDEO_OV9640
 
 config VIDEO_OV9650
 	tristate "OmniVision OV9650/OV9652 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP_SCCB
 	help
 	  This is a V4L2 sensor driver for the Omnivision
@@ -852,7 +908,9 @@ config VIDEO_OV9650
 
 config VIDEO_OV13858
 	tristate "OmniVision OV13858 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a Video4Linux2 sensor driver for the OmniVision
@@ -870,14 +928,18 @@ config VIDEO_VS6624
 
 config VIDEO_MT9M001
 	tristate "mt9m001 support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  This driver supports MT9M001 cameras from Micron, monochrome
 	  and colour models.
 
 config VIDEO_MT9M032
 	tristate "MT9M032 camera sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEO_APTINA_PLL
 	help
 	  This driver supports MT9M032 camera sensors from Aptina, monochrome
@@ -893,7 +955,9 @@ config VIDEO_MT9M111
 
 config VIDEO_MT9P031
 	tristate "Aptina MT9P031 support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEO_APTINA_PLL
 	help
 	  This is a Video4Linux2 sensor driver for the Aptina
@@ -901,7 +965,9 @@ config VIDEO_MT9P031
 
 config VIDEO_MT9T001
 	tristate "Aptina MT9T001 support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  This is a Video4Linux2 sensor driver for the Aptina
 	  (Micron) mt0t001 3 Mpixel camera.
@@ -926,7 +992,9 @@ config VIDEO_MT9V011
 
 config VIDEO_MT9V032
 	tristate "Micron MT9V032 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP_I2C
 	select V4L2_FWNODE
 	help
@@ -951,7 +1019,9 @@ config VIDEO_SR030PC30
 
 config VIDEO_NOON010PC30
 	tristate "Siliconfile NOON010PC30 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  This driver supports NOON010PC30 CIF camera from Siliconfile
 
@@ -969,21 +1039,27 @@ config VIDEO_RJ54N1
 
 config VIDEO_S5K6AA
 	tristate "Samsung S5K6AAFX sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  This is a V4L2 sensor driver for Samsung S5K6AA(FX) 1.3M
 	  camera sensor with an embedded SoC image signal processor.
 
 config VIDEO_S5K6A3
 	tristate "Samsung S5K6A3 sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  This is a V4L2 sensor driver for Samsung S5K6A3 raw
 	  camera sensor.
 
 config VIDEO_S5K4ECGX
 	tristate "Samsung S5K4ECGX sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select CRC32
 	help
 	  This is a V4L2 sensor driver for Samsung S5K4ECGX 5M
@@ -991,7 +1067,9 @@ config VIDEO_S5K4ECGX
 
 config VIDEO_S5K5BAF
 	tristate "Samsung S5K5BAF sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a V4L2 sensor driver for Samsung S5K5BAF 2M
@@ -1002,28 +1080,29 @@ source "drivers/media/i2c/et8ek8/Kconfig"
 
 config VIDEO_S5C73M3
 	tristate "Samsung S5C73M3 sensor support"
-	depends on I2C && SPI && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && SPI && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a V4L2 sensor driver for Samsung S5C73M3
 	  8 Mpixel camera.
-endif
 
 comment "Lens drivers"
 
-if MEDIA_CAMERA_SUPPORT
-
 config VIDEO_AD5820
 	tristate "AD5820 lens voice coil support"
-	depends on GPIOLIB && I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
+	depends on GPIOLIB && I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
 	help
 	  This is a driver for the AD5820 camera lens voice coil.
 	  It is used for example in Nokia N900 (RX-51).
 
 config VIDEO_AK7375
 	tristate "AK7375 lens voice coil support"
-	depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
-	depends on VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  This is a driver for the AK7375 camera lens voice coil.
 	  AK7375 is a 12 bit DAC with 120mA output current sink
@@ -1032,8 +1111,9 @@ config VIDEO_AK7375
 
 config VIDEO_DW9714
 	tristate "DW9714 lens voice coil support"
-	depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
-	depends on VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  This is a driver for the DW9714 camera lens voice coil.
 	  DW9714 is a 10 bit DAC with 120mA output current sink
@@ -1042,30 +1122,30 @@ config VIDEO_DW9714
 
 config VIDEO_DW9807_VCM
 	tristate "DW9807 lens voice coil support"
-	depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
-	depends on VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  This is a driver for the DW9807 camera lens voice coil.
 	  DW9807 is a 10 bit DAC with 100mA output current sink
 	  capability. This is designed for linear control of
 	  voice coil motors, controlled via I2C serial interface.
 
-endif
 
 comment "Flash devices"
 
-if MEDIA_CAMERA_SUPPORT
-
 config VIDEO_ADP1653
 	tristate "ADP1653 flash support"
-	depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
 	help
 	  This is a driver for the ADP1653 flash controller. It is used for
 	  example in Nokia N900.
 
 config VIDEO_LM3560
 	tristate "LM3560 dual flash driver support"
-	depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
 	select REGMAP_I2C
 	help
 	  This is a driver for the lm3560 dual flash controllers. It controls
@@ -1073,13 +1153,18 @@ config VIDEO_LM3560
 
 config VIDEO_LM3646
 	tristate "LM3646 dual flash driver support"
-	depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
 	select REGMAP_I2C
 	help
 	  This is a driver for the lm3646 dual flash controllers. It controls
 	  flash, torch LEDs.
 
-endif
+endif # MEDIA_CAMERA_SUPPORT
+
+#
+# Other V4L2 drivers that aren't related with Camera support
+#
 
 comment "Video improvement chips"
 
@@ -1168,8 +1253,9 @@ config VIDEO_I2C
 
 config VIDEO_ST_MIPID02
 	tristate "STMicroelectronics MIPID02 CSI-2 to PARALLEL bridge"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
-	depends on MEDIA_CAMERA_SUPPORT
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  Support for STMicroelectronics MIPID02 CSI-2 to PARALLEL bridge.
@@ -1181,4 +1267,4 @@ config VIDEO_ST_MIPID02
 
 endmenu
 
-endif
+endif # VIDEO_V4L2
drivers/media/i2c/et8ek8/Kconfig +3 -1
index 1c6909874d56..afcc4ea764f6 100644
@@ -1,7 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_ET8EK8
 	tristate "ET8EK8 camera sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  This is a driver for the Toshiba ET8EK8 5 MP camera sensor.
drivers/media/i2c/m5mols/Kconfig +3 -2
index e573482f269f..6f0ef33b7ee1 100644
@@ -1,7 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_M5MOLS
 	tristate "Fujitsu M-5MOLS 8MP sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
-	depends on MEDIA_CAMERA_SUPPORT
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  This driver supports Fujitsu M-5MOLS camera sensor with ISP
drivers/media/i2c/smiapp/Kconfig +3 -2
index fcaa7f9494a8..6893b532824f 100644
@@ -1,8 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_SMIAPP
 	tristate "SMIA++/SMIA sensor support"
-	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && HAVE_CLK
-	depends on MEDIA_CAMERA_SUPPORT
+	depends on I2C && VIDEO_V4L2 && HAVE_CLK
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEO_SMIAPP_PLL
 	select V4L2_FWNODE
 	help
drivers/media/mc/Kconfig +1 -1
index 0c5c52f14c64..e740ace54d7f 100644
@@ -7,7 +7,7 @@
 
 config MEDIA_CONTROLLER
 	bool "Media Controller API"
-	depends on MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT
+	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_PLATFORM_SUPPORT
 	help
 	  Enable the media controller API used to query media devices internal
 	  topology and configure it dynamically.
drivers/media/pci/cobalt/Kconfig +3 -1
index e0e7df460a92..d8d9ea6b09bc 100644
@@ -1,11 +1,13 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_COBALT
 	tristate "Cisco Cobalt support"
-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2 && I2C
 	depends on PCI_MSI && MTD_COMPLEX_MAPPINGS
 	depends on (GPIOLIB && DRM_I2C_ADV7511=n) || COMPILE_TEST
 	depends on SND
 	depends on MTD
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select I2C_ALGOBIT
 	select SND_PCM
 	select VIDEO_ADV7604
drivers/media/pci/intel/ipu3/Kconfig +2 -2
index f35bba16b60e..82d7f17e6a02 100644
@@ -2,9 +2,9 @@
 config VIDEO_IPU3_CIO2
 	tristate "Intel ipu3-cio2 driver"
 	depends on VIDEO_V4L2 && PCI
-	depends on VIDEO_V4L2_SUBDEV_API
 	depends on (X86 && ACPI) || COMPILE_TEST
-	depends on MEDIA_CONTROLLER
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	select VIDEOBUF2_DMA_SG
 
drivers/media/pci/sta2x11/Kconfig +3 -3
index 011b766f0bff..4dd98f94a91e 100644
@@ -1,12 +1,12 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config STA2X11_VIP
 	tristate "STA2X11 VIP Video For Linux"
+	depends on PCI && VIDEO_V4L2 && VIRT_TO_BUS && I2C
 	depends on STA2X11 || COMPILE_TEST
 	select VIDEO_ADV7180 if MEDIA_SUBDRV_AUTOSELECT
 	select VIDEOBUF2_DMA_CONTIG
-	depends on PCI && VIDEO_V4L2 && VIRT_TO_BUS
-	depends on VIDEO_V4L2_SUBDEV_API
-	depends on I2C
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  Say Y for support for STA2X11 VIP (Video Input Port) capture
 	  device.
drivers/media/platform/Kconfig +20 -8
index 6b693cd0576e..b8b2de5f1541 100644
@@ -63,7 +63,9 @@ config VIDEO_VIU
 config VIDEO_MUX
 	tristate "Video Multiplexer"
 	select MULTIPLEXER
-	depends on VIDEO_V4L2 && OF && VIDEO_V4L2_SUBDEV_API && MEDIA_CONTROLLER
+	depends on VIDEO_V4L2 && OF
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select REGMAP
 	select V4L2_FWNODE
 	help
@@ -71,10 +73,12 @@ config VIDEO_MUX
 
 config VIDEO_OMAP3
 	tristate "OMAP 3 Camera support"
-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2 && I2C
 	depends on (ARCH_OMAP3 && OMAP_IOMMU) || COMPILE_TEST
 	depends on COMMON_CLK && OF
 	select ARM_DMA_USE_IOMMU if OMAP_IOMMU
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select MFD_SYSCON
 	select V4L2_FWNODE
@@ -99,16 +103,19 @@ config VIDEO_PXA27x
 
 config VIDEO_QCOM_CAMSS
 	tristate "Qualcomm V4L2 Camera Subsystem driver"
-	depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2
 	depends on (ARCH_QCOM && IOMMU_DMA) || COMPILE_TEST
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_SG
 	select V4L2_FWNODE
 
 config VIDEO_S3C_CAMIF
 	tristate "Samsung S3C24XX/S3C64XX SoC Camera Interface driver"
-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
-	depends on PM
+	depends on VIDEO_V4L2 && I2C && PM
 	depends on ARCH_S3C64XX || PLAT_S3C24XX || COMPILE_TEST
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	help
 	  This is a v4l2 driver for s3c24xx and s3c64xx SoC series camera
@@ -119,9 +126,10 @@ config VIDEO_S3C_CAMIF
 
 config VIDEO_STM32_DCMI
 	tristate "STM32 Digital Camera Memory Interface (DCMI) support"
-	depends on VIDEO_V4L2 && OF && MEDIA_CONTROLLER
+	depends on VIDEO_V4L2 && OF
 	depends on ARCH_STM32 || COMPILE_TEST
 	select VIDEOBUF2_DMA_CONTIG
+	select MEDIA_CONTROLLER
 	select V4L2_FWNODE
 	help
 	  This module makes the STM32 Digital Camera Memory Interface (DCMI)
@@ -148,7 +156,9 @@ source "drivers/media/platform/sunxi/Kconfig"
 
 config VIDEO_TI_CAL
 	tristate "TI CAL (Camera Adaptation Layer) driver"
-	depends on VIDEO_DEV && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_DEV && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	depends on SOC_DRA7XX || ARCH_K3 || COMPILE_TEST
 	select VIDEOBUF2_DMA_CONTIG
 	select V4L2_FWNODE
@@ -432,9 +442,11 @@ config VIDEO_RENESAS_FCP
 
 config VIDEO_RENESAS_VSP1
 	tristate "Renesas VSP1 Video Processing Engine"
-	depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2
 	depends on ARCH_RENESAS || COMPILE_TEST
 	depends on (!ARM64 && !VIDEO_RENESAS_FCP) || VIDEO_RENESAS_FCP
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select VIDEOBUF2_VMALLOC
 	help
drivers/media/platform/am437x/Kconfig +3 -1
index d6f2e3d0cbef..9ef898f512de 100644
@@ -1,8 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_AM437X_VPFE
 	tristate "TI AM437x VPFE video capture driver"
-	depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2
 	depends on SOC_AM43XX || COMPILE_TEST
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select V4L2_FWNODE
 	help
drivers/media/platform/atmel/Kconfig +3 -1
index 5ae3f60b81b1..1850fe7f9360 100644
@@ -1,8 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_ATMEL_ISC
 	tristate "ATMEL Image Sensor Controller (ISC) support"
-	depends on VIDEO_V4L2 && COMMON_CLK && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2 && COMMON_CLK
 	depends on ARCH_AT91 || COMPILE_TEST
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select REGMAP_MMIO
 	select V4L2_FWNODE
drivers/media/platform/cadence/Kconfig +4 -4
index c154e368d701..80cf601323ce 100644
@@ -13,8 +13,8 @@ if VIDEO_CADENCE
 config VIDEO_CADENCE_CSI2RX
 	tristate "Cadence MIPI-CSI2 RX Controller"
 	depends on VIDEO_V4L2
-	depends on MEDIA_CONTROLLER
-	depends on VIDEO_V4L2_SUBDEV_API
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  Support for the Cadence MIPI CSI2 Receiver controller.
@@ -25,8 +25,8 @@ config VIDEO_CADENCE_CSI2RX
 config VIDEO_CADENCE_CSI2TX
 	tristate "Cadence MIPI-CSI2 TX Controller"
 	depends on VIDEO_V4L2
-	depends on MEDIA_CONTROLLER
-	depends on VIDEO_V4L2_SUBDEV_API
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  Support for the Cadence MIPI CSI2 Transceiver controller.
drivers/media/platform/exynos4-is/Kconfig +3 -2
index be4effcbfe7b..136d3b2a0fbb 100644
@@ -2,9 +2,10 @@
 
 config VIDEO_SAMSUNG_EXYNOS4_IS
 	tristate "Samsung S5P/EXYNOS4 SoC series Camera Subsystem driver"
-	depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2 && OF && COMMON_CLK
 	depends on ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST
-	depends on OF && COMMON_CLK
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select V4L2_FWNODE
 	help
 	  Say Y here to enable camera host interface devices for
drivers/media/platform/rcar-vin/Kconfig +6 -2
index 240ac3f3c941..ca0d906dce2f 100644
@@ -1,8 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
 config VIDEO_RCAR_CSI2
 	tristate "R-Car MIPI CSI-2 Receiver"
-	depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && OF
+	depends on VIDEO_V4L2 && OF
 	depends on ARCH_RENESAS || COMPILE_TEST
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select RESET_CONTROLLER
 	select V4L2_FWNODE
 	help
@@ -14,8 +16,10 @@ config VIDEO_RCAR_CSI2
 
 config VIDEO_RCAR_VIN
 	tristate "R-Car Video Input (VIN) Driver"
-	depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && OF && MEDIA_CONTROLLER
+	depends on VIDEO_V4L2 && OF
 	depends on ARCH_RENESAS || COMPILE_TEST
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select V4L2_FWNODE
 	help
drivers/media/platform/sunxi/sun4i-csi/Kconfig +3 -1
index 93b4e82a2655..903c6152f6e8 100644
@@ -2,8 +2,10 @@
 
 config VIDEO_SUN4I_CSI
 	tristate "Allwinner A10 CMOS Sensor Interface Support"
-	depends on VIDEO_V4L2 && COMMON_CLK && VIDEO_V4L2_SUBDEV_API && HAS_DMA
+	depends on VIDEO_V4L2 && COMMON_CLK  && HAS_DMA
 	depends on ARCH_SUNXI || COMPILE_TEST
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select V4L2_FWNODE
 	help
drivers/media/platform/sunxi/sun6i-csi/Kconfig +3 -1
index 269b3ebf4f52..586e3fb3a80d 100644
@@ -1,8 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_SUN6I_CSI
 	tristate "Allwinner V3s Camera Sensor Interface driver"
-	depends on VIDEO_V4L2 && COMMON_CLK && VIDEO_V4L2_SUBDEV_API && HAS_DMA
+	depends on VIDEO_V4L2 && COMMON_CLK  && HAS_DMA
 	depends on ARCH_SUNXI || COMPILE_TEST
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select REGMAP_MMIO
 	select V4L2_FWNODE
drivers/media/platform/xilinx/Kconfig +3 -1
index a2773ad7c185..01c96fb66414 100644
@@ -2,7 +2,9 @@
 
 config VIDEO_XILINX
 	tristate "Xilinx Video IP (EXPERIMENTAL)"
-	depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && OF && HAS_DMA
+	depends on VIDEO_V4L2  && OF && HAS_DMA
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select V4L2_FWNODE
 	help
drivers/media/spi/Kconfig +3 -1
index bcc49cb47de6..bf385d503cab 100644
@@ -9,7 +9,9 @@ menu "SPI helper chips"
 
 config VIDEO_GS1662
 	tristate "Gennum Serializers video"
-	depends on SPI && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on SPI && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	help
 	  Enable the GS1662 driver which serializes video streams.
 
drivers/media/test_drivers/vimc/Kconfig +3 -1
index bd221d3e1a4a..4068a67585f9 100644
@@ -1,7 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_VIMC
 	tristate "Virtual Media Controller Driver (VIMC)"
-	depends on VIDEO_DEV && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_DEV && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_VMALLOC
 	select VIDEO_V4L2_TPG
 	help
drivers/staging/media/hantro/Kconfig +3 -2
index 99aed9a5b0b9..68e5b06cdab7 100644
@@ -2,8 +2,9 @@
 config VIDEO_HANTRO
 	tristate "Hantro VPU driver"
 	depends on ARCH_MXC || ARCH_ROCKCHIP || COMPILE_TEST
-	depends on VIDEO_DEV && VIDEO_V4L2 && MEDIA_CONTROLLER
-	depends on MEDIA_CONTROLLER_REQUEST_API
+	depends on VIDEO_DEV && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select MEDIA_CONTROLLER_REQUEST_API
 	select VIDEOBUF2_DMA_CONTIG
 	select VIDEOBUF2_VMALLOC
 	select V4L2_MEM2MEM_DEV
drivers/staging/media/imx/Kconfig +3 -2
index 8f1ae50a4abd..f555aac8a9d5 100644
@@ -2,8 +2,9 @@
 config VIDEO_IMX_MEDIA
 	tristate "i.MX5/6 V4L2 media core driver"
 	depends on ARCH_MXC || COMPILE_TEST
-	depends on MEDIA_CONTROLLER && VIDEO_V4L2 && IMX_IPUV3_CORE
-	depends on VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2 && IMX_IPUV3_CORE
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	depends on HAS_DMA
 	select VIDEOBUF2_DMA_CONTIG
 	select V4L2_FWNODE
drivers/staging/media/ipu3/Kconfig +2 -1
index 4b51c67eac88..3e9640523e50 100644
@@ -2,8 +2,9 @@
 config VIDEO_IPU3_IMGU
 	tristate "Intel ipu3-imgu driver"
 	depends on PCI && VIDEO_V4L2
-	depends on MEDIA_CONTROLLER && VIDEO_V4L2_SUBDEV_API
 	depends on X86
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select IOMMU_IOVA
 	select VIDEOBUF2_DMA_SG
 	help
drivers/staging/media/omap4iss/Kconfig +3 -1
index 4dcbc5065821..6c254907a27b 100644
@@ -2,8 +2,10 @@
 
 config VIDEO_OMAP4
 	tristate "OMAP 4 Camera support"
-	depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && I2C
+	depends on VIDEO_V4L2  && I2C
 	depends on ARCH_OMAP4 || COMPILE_TEST
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select MFD_SYSCON
 	select VIDEOBUF2_DMA_CONTIG
 	help
drivers/staging/media/rkisp1/Kconfig +3 -1
index b859a493caba..5ecbefa0f5ec 100644
@@ -2,8 +2,10 @@
 
 config VIDEO_ROCKCHIP_ISP1
 	tristate "Rockchip Image Signal Processing v1 Unit driver"
-	depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+	depends on VIDEO_V4L2
 	depends on ARCH_ROCKCHIP || COMPILE_TEST
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
 	select VIDEOBUF2_DMA_CONTIG
 	select VIDEOBUF2_VMALLOC
 	select V4L2_FWNODE
drivers/staging/media/sunxi/cedrus/Kconfig +3 -2
index 17733e9a088f..da369950bbf2 100644
@@ -1,10 +1,11 @@
 # SPDX-License-Identifier: GPL-2.0
 config VIDEO_SUNXI_CEDRUS
 	tristate "Allwinner Cedrus VPU driver"
-	depends on VIDEO_DEV && VIDEO_V4L2 && MEDIA_CONTROLLER
+	depends on VIDEO_DEV && VIDEO_V4L2
 	depends on HAS_DMA
 	depends on OF
-	depends on MEDIA_CONTROLLER_REQUEST_API
+	select MEDIA_CONTROLLER
+	select MEDIA_CONTROLLER_REQUEST_API
 	select SUNXI_SRAM
 	select VIDEOBUF2_DMA_CONTIG
 	select V4L2_MEM2MEM_DEV
Signature · 1 line
2.25.1
#4 lore raw

PATCH v4 4/33 media: pci: move VIDEO_PCI_SKELETON to a different Kconfig

In reply to Mauro Carvalho Chehab

The V4L2 PCI skeleton is not part of the V4L2 core. Move it to appear together with the other PCI drivers, at the end, as this is something that normal users don't even need to bother.

---
 drivers/media/pci/Kconfig       | 10 ++++++++++
 drivers/media/v4l2-core/Kconfig | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/media/pci/Kconfig +10 -0
index dcb3719f440e..9336f8446cf0 100644
@@ -56,5 +56,15 @@ endif
 
 source "drivers/media/pci/intel/ipu3/Kconfig"
 
+config VIDEO_PCI_SKELETON
+	tristate "Skeleton PCI V4L2 driver"
+	depends on PCI
+	depends on SAMPLES
+	depends on VIDEO_V4L2 && VIDEOBUF2_CORE
+	depends on VIDEOBUF2_MEMOPS && VIDEOBUF2_DMA_CONTIG
+	help
+	  Enable build of the skeleton PCI driver, used as a reference
+	  when developing new drivers.
+
 endif #MEDIA_PCI_SUPPORT
 endif #PCI
drivers/media/v4l2-core/Kconfig +0 -10
index 39e3fb30ba0b..26276b257eae 100644
@@ -31,16 +31,6 @@ config VIDEO_FIXED_MINOR_RANGES
 
 	  When in doubt, say N.
 
-config VIDEO_PCI_SKELETON
-	tristate "Skeleton PCI V4L2 driver"
-	depends on PCI
-	depends on SAMPLES
-	depends on VIDEO_V4L2 && VIDEOBUF2_CORE
-	depends on VIDEOBUF2_MEMOPS && VIDEOBUF2_DMA_CONTIG
-	help
-	  Enable build of the skeleton PCI driver, used as a reference
-	  when developing new drivers.
-
 # Used by drivers that need tuner.ko
 config VIDEO_TUNER
 	tristate
Signature · 1 line
2.25.1
#31 lore raw

PATCH v4 24/33 media: Kconfig: move CEC-specific options to cec/Kconfig

In reply to Mauro Carvalho Chehab

There's no need to have the CEC definitions inside the media Kconfig, as the Kconfig parser doesn't require symbols to be declared before their usages.

With that, the main Kconfig menu becomes cleaner.

---
 drivers/media/Kconfig     |  9 ---------
 drivers/media/cec/Kconfig | 10 ++++++++++
 2 files changed, 10 insertions(+), 9 deletions(-)
drivers/media/Kconfig +0 -9
index 79aa83a966db..9cc528e0b120 100644
@@ -3,15 +3,6 @@
 # Multimedia device configuration
 #
 
-config CEC_CORE
-	tristate
-
-config CEC_NOTIFIER
-	bool
-
-config CEC_PIN
-	bool
-
 source "drivers/media/rc/Kconfig"
 
 menuconfig MEDIA_SUPPORT
drivers/media/cec/Kconfig +10 -0
index c01919713ab9..31417feaa213 100644
@@ -1,4 +1,14 @@
 # SPDX-License-Identifier: GPL-2.0-only
+
+config CEC_CORE
+	tristate
+
+config CEC_NOTIFIER
+	bool
+
+config CEC_PIN
+	bool
+
 config MEDIA_CEC_RC
 	bool "HDMI CEC RC integration"
 	depends on CEC_CORE && RC_CORE
Signature · 1 line
2.25.1
#36 lore raw

PATCH v4 29/33 media: Kconfig: move the position of sub-driver autoselection

In reply to Mauro Carvalho Chehab

Let's place the sub-driver-autoselection option just below the device filtering one, as it also controls a filter menu, with is not even visible if !EXPERT && !EMBEDDED.

---
 drivers/media/Kconfig | 50 +++++++++++++++++++++----------------------
 1 file changed, 25 insertions(+), 25 deletions(-)
drivers/media/Kconfig +25 -25
index c95b534c5d40..db918a89e40e 100644
@@ -33,6 +33,28 @@ config MEDIA_SUPPORT_FILTER
 	   needed to support media drivers will be enabled. Also, all
 	   media device drivers should be shown.
 
+config MEDIA_SUBDRV_AUTOSELECT
+	bool "Autoselect ancillary drivers (tuners, sensors, i2c, spi, frontends)"
+	depends on HAS_IOMEM
+	select I2C
+	select I2C_MUX
+	default y if MEDIA_SUPPORT_FILTER
+	help
+	  By default, a media driver auto-selects all possible ancillary
+	  devices such as tuners, sensors, video encoders/decoders and
+	  frontends, that are used by any of the supported devices.
+
+	  This is generally the right thing to do, except when there
+	  are strict constraints with regards to the kernel size,
+	  like on embedded systems.
+
+	  Use this option with care, as deselecting ancillary drivers which
+	  are, in fact, necessary will result in the lack of the needed
+	  functionality for your device (it may not tune or may not have
+	  the needed demodulators).
+
+	  If unsure say Y.
+
 menu "Media device types"
 	visible if MEDIA_SUPPORT_FILTER
 
@@ -197,40 +219,18 @@ source "drivers/media/firewire/Kconfig"
 
 endmenu
 
-menu "Media ancillary drivers (tuners, sensors, i2c, spi, frontends)"
-
 #
 # Ancillary drivers (tuners, i2c, spi, frontends)
 #
 
-config MEDIA_SUBDRV_AUTOSELECT
-	bool "Autoselect ancillary drivers (tuners, sensors, i2c, spi, frontends)"
-	depends on MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_CAMERA_SUPPORT || MEDIA_SDR_SUPPORT
-	depends on HAS_IOMEM
-	select I2C
-	select I2C_MUX
-	default y if !EMBEDDED
-	help
-	  By default, a media driver auto-selects all possible ancillary
-	  devices such as tuners, sensors, video encoders/decoders and
-	  frontends, that are used by any of the supported devices.
-
-	  This is generally the right thing to do, except when there
-	  are strict constraints with regards to the kernel size,
-	  like on embedded systems.
-
-	  Use this option with care, as deselecting ancillary drivers which
-	  are, in fact, necessary will result in the lack of the needed
-	  functionality for your device (it may not tune or may not have
-	  the needed demodulators).
-
-	  If unsure say Y.
-
 config MEDIA_HIDE_ANCILLARY_SUBDRV
 	bool
 	depends on MEDIA_SUBDRV_AUTOSELECT && !COMPILE_TEST && !EXPERT
 	default y
 
+menu "Media ancillary drivers"
+	visible if !MEDIA_HIDE_ANCILLARY_SUBDRV
+
 config MEDIA_ATTACH
 	bool
 	depends on MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_RADIO_SUPPORT
Signature · 1 line
2.25.1
#10 lore raw

PATCH v4 10/33 media: ddbridge: copy the dvb_dummy_fe driver to ddbridge

In reply to Mauro Carvalho Chehab

As we'll be transforming the dvb-dummy-fe driver soon into a virtual driver, let's first copy the existing one to ddbridge as-is, as it is needed there.

---
 .../media/pci/ddbridge/ddbridge-dummy-fe.c    | 286 ++++++++++++++++++
 .../media/pci/ddbridge/ddbridge-dummy-fe.h    |  36 +++
 2 files changed, 322 insertions(+)
 create mode 100644 drivers/media/pci/ddbridge/ddbridge-dummy-fe.c
 create mode 100644 drivers/media/pci/ddbridge/ddbridge-dummy-fe.h
drivers/media/pci/ddbridge/ddbridge-dummy-fe.c new file +286 -0
new file mode 100644
index 000000000000..9ff1ebaa5e04
@@ -0,0 +1,286 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *  Driver for Dummy Frontend
+ *
+ *  Written by Emard <[email protected]>
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/string.h>
+#include <linux/slab.h>
+
+#include <media/dvb_frontend.h>
+#include "dvb_dummy_fe.h"
+
+
+struct dvb_dummy_fe_state {
+	struct dvb_frontend frontend;
+};
+
+
+static int dvb_dummy_fe_read_status(struct dvb_frontend *fe,
+				    enum fe_status *status)
+{
+	*status = FE_HAS_SIGNAL
+		| FE_HAS_CARRIER
+		| FE_HAS_VITERBI
+		| FE_HAS_SYNC
+		| FE_HAS_LOCK;
+
+	return 0;
+}
+
+static int dvb_dummy_fe_read_ber(struct dvb_frontend *fe, u32 *ber)
+{
+	*ber = 0;
+	return 0;
+}
+
+static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe,
+					     u16 *strength)
+{
+	*strength = 0;
+	return 0;
+}
+
+static int dvb_dummy_fe_read_snr(struct dvb_frontend *fe, u16 *snr)
+{
+	*snr = 0;
+	return 0;
+}
+
+static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
+{
+	*ucblocks = 0;
+	return 0;
+}
+
+/*
+ * Should only be implemented if it actually reads something from the hardware.
+ * Also, it should check for the locks, in order to avoid report wrong data
+ * to userspace.
+ */
+static int dvb_dummy_fe_get_frontend(struct dvb_frontend *fe,
+				     struct dtv_frontend_properties *p)
+{
+	return 0;
+}
+
+static int dvb_dummy_fe_set_frontend(struct dvb_frontend *fe)
+{
+	if (fe->ops.tuner_ops.set_params) {
+		fe->ops.tuner_ops.set_params(fe);
+		if (fe->ops.i2c_gate_ctrl)
+			fe->ops.i2c_gate_ctrl(fe, 0);
+	}
+
+	return 0;
+}
+
+static int dvb_dummy_fe_sleep(struct dvb_frontend *fe)
+{
+	return 0;
+}
+
+static int dvb_dummy_fe_init(struct dvb_frontend *fe)
+{
+	return 0;
+}
+
+static int dvb_dummy_fe_set_tone(struct dvb_frontend *fe,
+				 enum fe_sec_tone_mode tone)
+{
+	return 0;
+}
+
+static int dvb_dummy_fe_set_voltage(struct dvb_frontend *fe,
+				    enum fe_sec_voltage voltage)
+{
+	return 0;
+}
+
+static void dvb_dummy_fe_release(struct dvb_frontend *fe)
+{
+	struct dvb_dummy_fe_state *state = fe->demodulator_priv;
+
+	kfree(state);
+}
+
+static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops;
+
+struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void)
+{
+	struct dvb_dummy_fe_state *state = NULL;
+
+	/* allocate memory for the internal state */
+	state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
+	if (!state)
+		return NULL;
+
+	/* create dvb_frontend */
+	memcpy(&state->frontend.ops,
+	       &dvb_dummy_fe_ofdm_ops,
+	       sizeof(struct dvb_frontend_ops));
+
+	state->frontend.demodulator_priv = state;
+	return &state->frontend;
+}
+EXPORT_SYMBOL(dvb_dummy_fe_ofdm_attach);
+
+static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops;
+
+struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
+{
+	struct dvb_dummy_fe_state *state = NULL;
+
+	/* allocate memory for the internal state */
+	state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
+	if (!state)
+		return NULL;
+
+	/* create dvb_frontend */
+	memcpy(&state->frontend.ops,
+	       &dvb_dummy_fe_qpsk_ops,
+	       sizeof(struct dvb_frontend_ops));
+
+	state->frontend.demodulator_priv = state;
+	return &state->frontend;
+}
+EXPORT_SYMBOL(dvb_dummy_fe_qpsk_attach);
+
+static const struct dvb_frontend_ops dvb_dummy_fe_qam_ops;
+
+struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
+{
+	struct dvb_dummy_fe_state *state = NULL;
+
+	/* allocate memory for the internal state */
+	state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
+	if (!state)
+		return NULL;
+
+	/* create dvb_frontend */
+	memcpy(&state->frontend.ops,
+	       &dvb_dummy_fe_qam_ops,
+	       sizeof(struct dvb_frontend_ops));
+
+	state->frontend.demodulator_priv = state;
+	return &state->frontend;
+}
+EXPORT_SYMBOL(dvb_dummy_fe_qam_attach);
+
+static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
+	.delsys = { SYS_DVBT },
+	.info = {
+		.name			= "Dummy DVB-T",
+		.frequency_min_hz	= 0,
+		.frequency_max_hz	= 863250 * kHz,
+		.frequency_stepsize_hz	= 62500,
+		.caps = FE_CAN_FEC_1_2 |
+			FE_CAN_FEC_2_3 |
+			FE_CAN_FEC_3_4 |
+			FE_CAN_FEC_4_5 |
+			FE_CAN_FEC_5_6 |
+			FE_CAN_FEC_6_7 |
+			FE_CAN_FEC_7_8 |
+			FE_CAN_FEC_8_9 |
+			FE_CAN_FEC_AUTO |
+			FE_CAN_QAM_16 |
+			FE_CAN_QAM_64 |
+			FE_CAN_QAM_AUTO |
+			FE_CAN_TRANSMISSION_MODE_AUTO |
+			FE_CAN_GUARD_INTERVAL_AUTO |
+			FE_CAN_HIERARCHY_AUTO,
+	},
+
+	.release = dvb_dummy_fe_release,
+
+	.init = dvb_dummy_fe_init,
+	.sleep = dvb_dummy_fe_sleep,
+
+	.set_frontend = dvb_dummy_fe_set_frontend,
+	.get_frontend = dvb_dummy_fe_get_frontend,
+
+	.read_status = dvb_dummy_fe_read_status,
+	.read_ber = dvb_dummy_fe_read_ber,
+	.read_signal_strength = dvb_dummy_fe_read_signal_strength,
+	.read_snr = dvb_dummy_fe_read_snr,
+	.read_ucblocks = dvb_dummy_fe_read_ucblocks,
+};
+
+static const struct dvb_frontend_ops dvb_dummy_fe_qam_ops = {
+	.delsys = { SYS_DVBC_ANNEX_A },
+	.info = {
+		.name			= "Dummy DVB-C",
+		.frequency_min_hz	=  51 * MHz,
+		.frequency_max_hz	= 858 * MHz,
+		.frequency_stepsize_hz	= 62500,
+		/* symbol_rate_min: SACLK/64 == (XIN/2)/64 */
+		.symbol_rate_min	= (57840000 / 2) / 64,
+		.symbol_rate_max	= (57840000 / 2) / 4,   /* SACLK/4 */
+		.caps = FE_CAN_QAM_16 |
+			FE_CAN_QAM_32 |
+			FE_CAN_QAM_64 |
+			FE_CAN_QAM_128 |
+			FE_CAN_QAM_256 |
+			FE_CAN_FEC_AUTO |
+			FE_CAN_INVERSION_AUTO
+	},
+
+	.release = dvb_dummy_fe_release,
+
+	.init = dvb_dummy_fe_init,
+	.sleep = dvb_dummy_fe_sleep,
+
+	.set_frontend = dvb_dummy_fe_set_frontend,
+	.get_frontend = dvb_dummy_fe_get_frontend,
+
+	.read_status = dvb_dummy_fe_read_status,
+	.read_ber = dvb_dummy_fe_read_ber,
+	.read_signal_strength = dvb_dummy_fe_read_signal_strength,
+	.read_snr = dvb_dummy_fe_read_snr,
+	.read_ucblocks = dvb_dummy_fe_read_ucblocks,
+};
+
+static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = {
+	.delsys = { SYS_DVBS },
+	.info = {
+		.name			= "Dummy DVB-S",
+		.frequency_min_hz	=  950 * MHz,
+		.frequency_max_hz	= 2150 * MHz,
+		.frequency_stepsize_hz	= 250 * kHz,
+		.frequency_tolerance_hz	= 29500 * kHz,
+		.symbol_rate_min	= 1000000,
+		.symbol_rate_max	= 45000000,
+		.caps = FE_CAN_INVERSION_AUTO |
+			FE_CAN_FEC_1_2 |
+			FE_CAN_FEC_2_3 |
+			FE_CAN_FEC_3_4 |
+			FE_CAN_FEC_5_6 |
+			FE_CAN_FEC_7_8 |
+			FE_CAN_FEC_AUTO |
+			FE_CAN_QPSK
+	},
+
+	.release = dvb_dummy_fe_release,
+
+	.init = dvb_dummy_fe_init,
+	.sleep = dvb_dummy_fe_sleep,
+
+	.set_frontend = dvb_dummy_fe_set_frontend,
+	.get_frontend = dvb_dummy_fe_get_frontend,
+
+	.read_status = dvb_dummy_fe_read_status,
+	.read_ber = dvb_dummy_fe_read_ber,
+	.read_signal_strength = dvb_dummy_fe_read_signal_strength,
+	.read_snr = dvb_dummy_fe_read_snr,
+	.read_ucblocks = dvb_dummy_fe_read_ucblocks,
+
+	.set_voltage = dvb_dummy_fe_set_voltage,
+	.set_tone = dvb_dummy_fe_set_tone,
+};
+
+MODULE_DESCRIPTION("DVB DUMMY Frontend");
+MODULE_AUTHOR("Emard");
+MODULE_LICENSE("GPL");
drivers/media/pci/ddbridge/ddbridge-dummy-fe.h new file +36 -0
new file mode 100644
index 000000000000..463abf5ebd56
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ *  Driver for Dummy Frontend
+ *
+ *  Written by Emard <[email protected]>
+ */
+
+#ifndef DVB_DUMMY_FE_H
+#define DVB_DUMMY_FE_H
+
+#include <linux/dvb/frontend.h>
+#include <media/dvb_frontend.h>
+
+#if IS_REACHABLE(CONFIG_DVB_DUMMY_FE)
+struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void);
+struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void);
+struct dvb_frontend *dvb_dummy_fe_qam_attach(void);
+#else
+static inline struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void)
+{
+	pr_warn("%s: driver disabled by Kconfig\n", __func__);
+	return NULL;
+}
+static inline struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
+{
+	pr_warn("%s: driver disabled by Kconfig\n", __func__);
+	return NULL;
+}
+static inline struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
+{
+	pr_warn("%s: driver disabled by Kconfig\n", __func__);
+	return NULL;
+}
+#endif /* CONFIG_DVB_DUMMY_FE */
+
+#endif // DVB_DUMMY_FE_H
Signature · 1 line
2.25.1
#38 lore raw

PATCH v4 31/33 media: Kconfig: Better organize the per-API options

In reply to Mauro Carvalho Chehab

After this change, the menu is displayed like above.

1) When filtering is not active:

    --- Multimedia support
        [ ]   Filter devices by their types
        [*]   Autoselect ancillary drivers (tuners, sensors, i2c, spi, frontends)
              Media core support  --->
              Video4Linux options  --->
              Media controller options  --->
              Digital TV options  --->
              HDMI CEC options  --->
              Media drivers  --->

2) When filtering is active:

    --- Multimedia support
        [*]   Filter devices by their types
        [*]   Autoselect ancillary drivers (tuners, sensors, i2c, spi, frontends)
              Media device types  --->
              Video4Linux options  --->
              Media controller options  --->
              Digital TV options  --->
              HDMI CEC options  --->
              Media drivers  --->

The per-API menu will only be displayed if the corresponding core support is enabled.

---
 drivers/media/Kconfig | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/media/Kconfig +18 -1
index 913903c8e942..382366b8ab46 100644
@@ -191,10 +191,27 @@ endmenu # Media core support
 #
 # Extra per-media API core functionality
 
-menu "Media core additional options"
+menu "Video4Linux options"
+	visible if VIDEO_DEV
+
 source "drivers/media/v4l2-core/Kconfig"
+endmenu
+
+menu "Media controller options"
+	visible if MEDIA_CONTROLLER
+
 source "drivers/media/mc/Kconfig"
+endmenu
+
+menu "Digital TV options"
+	visible if DVB_CORE
+
 source "drivers/media/dvb-core/Kconfig"
+endmenu
+
+menu "HDMI CEC options"
+	visible if CEC_CORE
+
 source "drivers/media/cec/Kconfig"
 endmenu
 
Signature · 1 line
2.25.1
#28 lore raw

PATCH v4 21/33 media: Kconfig: use a sub-menu to select supported devices

In reply to Mauro Carvalho Chehab

The media subsystem has hundreds of driver-specific options. The *_SUPPORT config options work as a sort of filter, allowing to reduce its complexity for users that won't want to dig into thousands of options they don't need.

Yet, it the filtering options are becoming large. So, let's place it on a sub-menu.

---
 drivers/media/Kconfig | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
drivers/media/Kconfig +14 -11
index b1a6874acbcc..a57f898fa35e 100644
@@ -25,36 +25,35 @@ menuconfig MEDIA_SUPPORT
 	  Additional info and docs are available on the web at
 	  <https://linuxtv.org>
 
-if MEDIA_SUPPORT
-
-comment "Multimedia core support"
+menu "Types of devices to be supported"
+	depends on MEDIA_SUPPORT
 
 #
 # Multimedia support - automatically enable V4L2 and DVB core
 #
 config MEDIA_CAMERA_SUPPORT
-	bool "Cameras/video grabbers support"
+	bool "Cameras and video grabbers"
 	help
 	  Enable support for webcams and video grabbers.
 
 	  Say Y when you have a webcam or a video capture grabber board.
 
 config MEDIA_ANALOG_TV_SUPPORT
-	bool "Analog TV support"
+	bool "Analog TV"
 	help
 	  Enable analog TV support.
 
 	  Say Y when you have a board with analog TV support.
 
 config MEDIA_DIGITAL_TV_SUPPORT
-	bool "Digital TV support"
+	bool "Digital TV"
 	help
 	  Enable digital TV support.
 
 	  Say Y when you have a board with digital TV support.
 
 config MEDIA_RADIO_SUPPORT
-	bool "AM/FM radio receivers/transmitters support"
+	bool "AM/FM radio receivers/transmitters"
 	help
 	  Enable AM/FM radio support.
 
@@ -64,14 +63,14 @@ config MEDIA_RADIO_SUPPORT
 	  Say Y when you have a board with radio support.
 
 config MEDIA_SDR_SUPPORT
-	bool "Software defined radio support"
+	bool "Software defined radio"
 	help
 	  Enable software defined radio support.
 
 	  Say Y when you have a software defined radio device.
 
 config MEDIA_CEC_SUPPORT
-	bool "HDMI CEC support"
+	bool "HDMI CEC"
 	help
 	  Enable support for HDMI CEC (Consumer Electronics Control),
 	  which is an optional HDMI feature.
@@ -80,7 +79,7 @@ config MEDIA_CEC_SUPPORT
 	  adapter that supports HDMI CEC.
 
 config MEDIA_PLATFORM_SUPPORT
-	bool "Platform-specific devices support"
+	bool "Platform-specific devices"
 	help
 	  Enable support for complex cameras, codecs, and other hardware
 	  that are integrated at the CPU, GPU or on Image Signalling Processor
@@ -92,7 +91,7 @@ config MEDIA_PLATFORM_SUPPORT
 	  Say Y when you want to be able so see such devices.
 
 config MEDIA_TEST_SUPPORT
-	bool "Test drivers support"
+	bool "Test drivers"
 	help
 	  Those drivers should not be used on production Kernels, but
 	  can be useful on debug ones. It enables several dummy drivers
@@ -103,6 +102,10 @@ config MEDIA_TEST_SUPPORT
 	  Say Y if you want to use some virtual test driver.
 
 	  In case of doubts, say N.
+	  Say Y when you have a software defined radio device.
+endmenu # Types of devices to be supported
+
+if MEDIA_SUPPORT
 
 comment "Multimedia core features"
 
Signature · 1 line
2.25.1
#32 lore raw

PATCH v4 25/33 media: Kconfig: move DVB-specific options to dvb-core/Kconfig

In reply to Mauro Carvalho Chehab

In order to cleanup the main media Kconfig, move the DVB-core specific options to dvb-core/Kconfig.

---
 drivers/media/Kconfig          | 21 ---------------------
 drivers/media/dvb-core/Kconfig | 26 ++++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 21 deletions(-)
drivers/media/Kconfig +0 -21
index 9cc528e0b120..dda449556f22 100644
@@ -161,31 +161,10 @@ config DVB_CORE
 	default y
 	select CRC32
 
-config DVB_MMAP
-	bool "Enable DVB memory-mapped API (EXPERIMENTAL)"
-	depends on DVB_CORE
-	depends on VIDEO_V4L2=y || VIDEO_V4L2=DVB_CORE
-	select VIDEOBUF2_VMALLOC
 	help
-	  This option enables DVB experimental memory-mapped API, which
-	  reduces the number of context switches to read DVB buffers, as
-	  the buffers can use mmap() syscalls.
 
-	  Support for it is experimental. Use with care. If unsure,
-	  say N.
 
-config DVB_NET
-	bool "DVB Network Support"
-	default (NET && INET)
-	depends on NET && INET && DVB_CORE
-	help
-	  This option enables DVB Network Support which is a part of the DVB
-	  standard. It is used, for example, by automatic firmware updates used
-	  on Set-Top-Boxes. It can also be used to access the Internet via the
-	  DVB card, if the network provider supports it.
 
-	  You may want to disable the network support on embedded devices. If
-	  unsure say Y.
 
 source "drivers/media/v4l2-core/Kconfig"
 source "drivers/media/mc/Kconfig"
drivers/media/dvb-core/Kconfig +26 -0
index 61f9e1ce99cb..6ffac618417b 100644
@@ -3,6 +3,32 @@
 # DVB device configuration
 #
 
+config DVB_MMAP
+	bool "Enable DVB memory-mapped API (EXPERIMENTAL)"
+	depends on DVB_CORE
+	depends on VIDEO_V4L2=y || VIDEO_V4L2=DVB_CORE
+	select VIDEOBUF2_VMALLOC
+	help
+	  This option enables DVB experimental memory-mapped API, which
+	  reduces the number of context switches to read DVB buffers, as
+	  the buffers can use mmap() syscalls.
+
+	  Support for it is experimental. Use with care. If unsure,
+	  say N.
+
+config DVB_NET
+	bool "DVB Network Support"
+	default (NET && INET)
+	depends on NET && INET && DVB_CORE
+	help
+	  This option enables DVB Network Support which is a part of the DVB
+	  standard. It is used, for example, by automatic firmware updates used
+	  on Set-Top-Boxes. It can also be used to access the Internet via the
+	  DVB card, if the network provider supports it.
+
+	  You may want to disable the network support on embedded devices. If
+	  unsure say Y.
+
 config DVB_MAX_ADAPTERS
 	int "maximum number of DVB/ATSC adapters"
 	depends on DVB_CORE
Signature · 1 line
2.25.1
#12 lore raw

PATCH v4 12/33 media: ddbridge: use the ddbridge's own dummy fe driver

In reply to Mauro Carvalho Chehab

Cleanup the ddbridge's dummy driver by removing the parts that aren't needed by ddbridge, adding it to the building system and changing the binding at the driver to use the newer function name.

---
 drivers/media/pci/ddbridge/Kconfig            |   1 -
 drivers/media/pci/ddbridge/Makefile           |   2 +-
 drivers/media/pci/ddbridge/ddbridge-core.c    |   4 +-
 .../media/pci/ddbridge/ddbridge-dummy-fe.c    | 133 ------------------
 .../media/pci/ddbridge/ddbridge-dummy-fe.h    |  20 ---
 5 files changed, 3 insertions(+), 157 deletions(-)
drivers/media/pci/ddbridge/Kconfig +0 -1
index dab34fb85c09..169efd558e45 100644
@@ -15,7 +15,6 @@ config DVB_DDBRIDGE
 	select MEDIA_TUNER_TDA18212 if MEDIA_SUBDRV_AUTOSELECT
 	select DVB_MXL5XX if MEDIA_SUBDRV_AUTOSELECT
 	select DVB_CXD2099 if MEDIA_SUBDRV_AUTOSELECT
-	select DVB_DUMMY_FE if MEDIA_SUBDRV_AUTOSELECT
 	help
 	  Support for cards with the Digital Devices PCI express bridge:
 	  - Octopus PCIe Bridge
drivers/media/pci/ddbridge/Makefile +1 -1
index 2b77c8d0eb2e..5e7eab81173b 100644
@@ -7,7 +7,7 @@ ddbridge-objs := ddbridge-main.o ddbridge-core.o ddbridge-ci.o \
 		ddbridge-hw.o ddbridge-i2c.o ddbridge-max.o ddbridge-mci.o \
 		ddbridge-sx8.o
 
-obj-$(CONFIG_DVB_DDBRIDGE) += ddbridge.o
+obj-$(CONFIG_DVB_DDBRIDGE) += ddbridge.o ddbridge-dummy-fe.o
 
 ccflags-y += -I $(srctree)/drivers/media/dvb-frontends/
 ccflags-y += -I $(srctree)/drivers/media/tuners/
drivers/media/pci/ddbridge/ddbridge-core.c +2 -2
index 7a2d19682fe3..7cabb9e9ffe2 100644
@@ -50,7 +50,7 @@
 #include "stv6111.h"
 #include "lnbh25.h"
 #include "cxd2099.h"
-#include "dvb_dummy_fe.h"
+#include "ddbridge-dummy-fe.h"
 
 /****************************************************************************/
 
@@ -1265,7 +1265,7 @@ static int demod_attach_dummy(struct ddb_input *input)
 	struct ddb_dvb *dvb = &input->port->dvb[input->nr & 1];
 	struct device *dev = input->port->dev->dev;
 
-	dvb->fe = dvb_attach(dvb_dummy_fe_qam_attach);
+	dvb->fe = dvb_attach(ddbridge_dummy_fe_qam_attach);
 	if (!dvb->fe) {
 		dev_err(dev, "QAM dummy attach failed!\n");
 		return -ENODEV;
drivers/media/pci/ddbridge/ddbridge-dummy-fe.c +0 -133

167 lines not on this page · raw message

drivers/media/pci/ddbridge/ddbridge-dummy-fe.h +0 -20
index 811c203539e2..ddf189c09524 100644
@@ -11,26 +11,6 @@
 #include <linux/dvb/frontend.h>
 #include <media/dvb_frontend.h>
 
-#if IS_REACHABLE(CONFIG_DDBRIDGE_DUMMY_FE)
-struct dvb_frontend *ddbridge_dummy_fe_ofdm_attach(void);
-struct dvb_frontend *ddbridge_dummy_fe_qpsk_attach(void);
 struct dvb_frontend *ddbridge_dummy_fe_qam_attach(void);
-#else
-static inline struct dvb_frontend *ddbridge_dummy_fe_ofdm_attach(void)
-{
-	pr_warn("%s: driver disabled by Kconfig\n", __func__);
-	return NULL;
-}
-static inline struct dvb_frontend *ddbridge_dummy_fe_qpsk_attach(void)
-{
-	pr_warn("%s: driver disabled by Kconfig\n", __func__);
-	return NULL;
-}
-static inline struct dvb_frontend *ddbridge_dummy_fe_qam_attach(void)
-{
-	pr_warn("%s: driver disabled by Kconfig\n", __func__);
-	return NULL;
-}
-#endif /* CONFIG_DDBRIDGE_DUMMY_FE */
 
 #endif // DDBRIDGE_DUMMY_FE_H
Signature · 1 line
2.25.1
#29 lore raw

PATCH v4 22/33 media: Kconfig: make filtering devices optional

In reply to Mauro Carvalho Chehab

The per-device option selection is a feature that some developers love, while others hate...

So, let's make both happy by making it optional.

---
 drivers/media/Kconfig | 31 +++++++++++++++++++++++++++----
 1 file changed, 27 insertions(+), 4 deletions(-)
drivers/media/Kconfig +27 -4
index a57f898fa35e..8b070fb703f9 100644
@@ -25,14 +25,32 @@ menuconfig MEDIA_SUPPORT
 	  Additional info and docs are available on the web at
 	  <https://linuxtv.org>
 
-menu "Types of devices to be supported"
+if MEDIA_SUPPORT
+
+config MEDIA_SUPPORT_FILTER
+	bool "Filter devices by their types"
 	depends on MEDIA_SUPPORT
+	help
+	   Configuring the media subsystem can be complex, as there are
+	   hundreds of drivers and other config options.
+
+	   This menu offers option that will help the Kernel's config
+	   system to hide drivers that are out of the scope of the
+	   user needs, and disabling core support for unused APIs.
+
+	   If not selected, all non-optional media core functionality
+	   needed to support media drivers will be enabled. Also, all
+	   media device drivers should be shown.
+
+menu "Media device types"
+	visible if MEDIA_SUPPORT_FILTER
 
 #
 # Multimedia support - automatically enable V4L2 and DVB core
 #
 config MEDIA_CAMERA_SUPPORT
 	bool "Cameras and video grabbers"
+	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable support for webcams and video grabbers.
 
@@ -40,6 +58,7 @@ config MEDIA_CAMERA_SUPPORT
 
 config MEDIA_ANALOG_TV_SUPPORT
 	bool "Analog TV"
+	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable analog TV support.
 
@@ -47,6 +66,7 @@ config MEDIA_ANALOG_TV_SUPPORT
 
 config MEDIA_DIGITAL_TV_SUPPORT
 	bool "Digital TV"
+	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable digital TV support.
 
@@ -54,6 +74,7 @@ config MEDIA_DIGITAL_TV_SUPPORT
 
 config MEDIA_RADIO_SUPPORT
 	bool "AM/FM radio receivers/transmitters"
+	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable AM/FM radio support.
 
@@ -64,6 +85,7 @@ config MEDIA_RADIO_SUPPORT
 
 config MEDIA_SDR_SUPPORT
 	bool "Software defined radio"
+	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable software defined radio support.
 
@@ -71,6 +93,7 @@ config MEDIA_SDR_SUPPORT
 
 config MEDIA_CEC_SUPPORT
 	bool "HDMI CEC"
+	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable support for HDMI CEC (Consumer Electronics Control),
 	  which is an optional HDMI feature.
@@ -80,6 +103,7 @@ config MEDIA_CEC_SUPPORT
 
 config MEDIA_PLATFORM_SUPPORT
 	bool "Platform-specific devices"
+	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable support for complex cameras, codecs, and other hardware
 	  that are integrated at the CPU, GPU or on Image Signalling Processor
@@ -92,6 +116,7 @@ config MEDIA_PLATFORM_SUPPORT
 
 config MEDIA_TEST_SUPPORT
 	bool "Test drivers"
+	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Those drivers should not be used on production Kernels, but
 	  can be useful on debug ones. It enables several dummy drivers
@@ -103,9 +128,7 @@ config MEDIA_TEST_SUPPORT
 
 	  In case of doubts, say N.
 	  Say Y when you have a software defined radio device.
-endmenu # Types of devices to be supported
-
-if MEDIA_SUPPORT
+endmenu # media device types
 
 comment "Multimedia core features"
 
Signature · 1 line
2.25.1
#40 lore raw

PATCH v4 33/33 media: Kconfig: don't use visible for device type select

In reply to Mauro Carvalho Chehab

While making the menu invisible seemed a good idea, there's a drawback: when the menu is not visible, it is not parsing the "default" dependency.

So, instead, let's just avoid the items at the menu to be prompted, by using the "prompt ... if" construction.

---
 drivers/media/Kconfig | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)
drivers/media/Kconfig +16 -9
index 382366b8ab46..0972a42e7e0c 100644
@@ -57,13 +57,13 @@ config MEDIA_SUBDRV_AUTOSELECT
 	  If unsure say Y.
 
 menu "Media device types"
-	visible if MEDIA_SUPPORT_FILTER
 
 #
 # Multimedia support - automatically enable V4L2 and DVB core
 #
 config MEDIA_CAMERA_SUPPORT
-	bool "Cameras and video grabbers"
+	bool
+	prompt "Cameras and video grabbers" if MEDIA_SUPPORT_FILTER
 	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable support for webcams and video grabbers.
@@ -71,7 +71,8 @@ config MEDIA_CAMERA_SUPPORT
 	  Say Y when you have a webcam or a video capture grabber board.
 
 config MEDIA_ANALOG_TV_SUPPORT
-	bool "Analog TV"
+	bool
+	prompt "Analog TV" if MEDIA_SUPPORT_FILTER
 	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable analog TV support.
@@ -79,7 +80,8 @@ config MEDIA_ANALOG_TV_SUPPORT
 	  Say Y when you have a board with analog TV support.
 
 config MEDIA_DIGITAL_TV_SUPPORT
-	bool "Digital TV"
+	bool
+	prompt "Digital TV" if MEDIA_SUPPORT_FILTER
 	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable digital TV support.
@@ -87,7 +89,8 @@ config MEDIA_DIGITAL_TV_SUPPORT
 	  Say Y when you have a board with digital TV support.
 
 config MEDIA_RADIO_SUPPORT
-	bool "AM/FM radio receivers/transmitters"
+	bool
+	prompt "AM/FM radio receivers/transmitters" if MEDIA_SUPPORT_FILTER
 	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable AM/FM radio support.
@@ -98,7 +101,8 @@ config MEDIA_RADIO_SUPPORT
 	  Say Y when you have a board with radio support.
 
 config MEDIA_SDR_SUPPORT
-	bool "Software defined radio"
+	bool
+	prompt "Software defined radio" if MEDIA_SUPPORT_FILTER
 	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable software defined radio support.
@@ -106,7 +110,8 @@ config MEDIA_SDR_SUPPORT
 	  Say Y when you have a software defined radio device.
 
 config MEDIA_CEC_SUPPORT
-	bool "HDMI CEC"
+	bool
+	prompt "HDMI CEC support" if MEDIA_SUPPORT_FILTER
 	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable support for HDMI CEC (Consumer Electronics Control),
@@ -116,7 +121,8 @@ config MEDIA_CEC_SUPPORT
 	  adapter that supports HDMI CEC.
 
 config MEDIA_PLATFORM_SUPPORT
-	bool "Platform-specific devices"
+	bool
+	prompt "Platform-specific devices" if MEDIA_SUPPORT_FILTER
 	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Enable support for complex cameras, codecs, and other hardware
@@ -129,7 +135,8 @@ config MEDIA_PLATFORM_SUPPORT
 	  Say Y when you want to be able so see such devices.
 
 config MEDIA_TEST_SUPPORT
-	bool "Test drivers"
+	bool
+	prompt "Test drivers" if MEDIA_SUPPORT_FILTER
 	default y if !MEDIA_SUPPORT_FILTER
 	help
 	  Those drivers should not be used on production Kernels, but
Signature · 1 line
2.25.1
#6 lore raw

PATCH v4 6/33 media: split test drivers from platform directory

In reply to Mauro Carvalho Chehab

When the first test device was added (vivi.c), there were just one file. I was too lazy on that time to create a separate directory just for it, so I kept it together with platform.

Now, we have vivid, vicodec, vim2m and vimc. Also, a new virtual driver has been prepared to support DVB API.

So, it is time to solve this mess, by placing test stuff on a separate directory.

It should be noticed that we also have some skeleton drivers (for V4L and for DVB). For now, we'll keep them separate, as they're not really test drivers, but instead, just examples. The DVB frontend ones will likely be part of a new DVB test driver. By that time, it should make sense to move them here as well.

---
 drivers/media/Kconfig                         | 14 ++++++++++
 drivers/media/platform/Kconfig                | 23 ---------------
 drivers/media/platform/Makefile               |  5 ----
 drivers/media/test_drivers/Kconfig            | 28 +++++++++++++++++++
 drivers/media/test_drivers/Makefile           |  9 ++++++
 .../vicodec/Kconfig                           |  0
 .../vicodec/Makefile                          |  0
 .../vicodec/codec-fwht.c                      |  0
 .../vicodec/codec-fwht.h                      |  0
 .../vicodec/codec-v4l2-fwht.c                 |  0
 .../vicodec/codec-v4l2-fwht.h                 |  0
 .../vicodec/vicodec-core.c                    |  0
 .../media/{platform => test_drivers}/vim2m.c  |  0
 .../{platform => test_drivers}/vimc/Kconfig   |  0
 .../{platform => test_drivers}/vimc/Makefile  |  0
 .../vimc/vimc-capture.c                       |  0
 .../vimc/vimc-common.c                        |  0
 .../vimc/vimc-common.h                        |  0
 .../vimc/vimc-core.c                          |  0
 .../vimc/vimc-debayer.c                       |  0
 .../vimc/vimc-scaler.c                        |  0
 .../vimc/vimc-sensor.c                        |  0
 .../vimc/vimc-streamer.c                      |  0
 .../vimc/vimc-streamer.h                      |  0
 .../{platform => test_drivers}/vivid/Kconfig  |  0
 .../{platform => test_drivers}/vivid/Makefile |  0
 .../vivid/vivid-cec.c                         |  0
 .../vivid/vivid-cec.h                         |  0
 .../vivid/vivid-core.c                        |  0
 .../vivid/vivid-core.h                        |  0
 .../vivid/vivid-ctrls.c                       |  0
 .../vivid/vivid-ctrls.h                       |  0
 .../vivid/vivid-kthread-cap.c                 |  0
 .../vivid/vivid-kthread-cap.h                 |  0
 .../vivid/vivid-kthread-out.c                 |  0
 .../vivid/vivid-kthread-out.h                 |  0
 .../vivid/vivid-kthread-touch.c               |  0
 .../vivid/vivid-kthread-touch.h               |  0
 .../vivid/vivid-meta-cap.c                    |  0
 .../vivid/vivid-meta-cap.h                    |  0
 .../vivid/vivid-meta-out.c                    |  0
 .../vivid/vivid-meta-out.h                    |  0
 .../vivid/vivid-osd.c                         |  0
 .../vivid/vivid-osd.h                         |  0
 .../vivid/vivid-radio-common.c                |  0
 .../vivid/vivid-radio-common.h                |  0
 .../vivid/vivid-radio-rx.c                    |  0
 .../vivid/vivid-radio-rx.h                    |  0
 .../vivid/vivid-radio-tx.c                    |  0
 .../vivid/vivid-radio-tx.h                    |  0
 .../vivid/vivid-rds-gen.c                     |  0
 .../vivid/vivid-rds-gen.h                     |  0
 .../vivid/vivid-sdr-cap.c                     |  0
 .../vivid/vivid-sdr-cap.h                     |  0
 .../vivid/vivid-touch-cap.c                   |  0
 .../vivid/vivid-touch-cap.h                   |  0
 .../vivid/vivid-vbi-cap.c                     |  0
 .../vivid/vivid-vbi-cap.h                     |  0
 .../vivid/vivid-vbi-gen.c                     |  0
 .../vivid/vivid-vbi-gen.h                     |  0
 .../vivid/vivid-vbi-out.c                     |  0
 .../vivid/vivid-vbi-out.h                     |  0
 .../vivid/vivid-vid-cap.c                     |  0
 .../vivid/vivid-vid-cap.h                     |  0
 .../vivid/vivid-vid-common.c                  |  0
 .../vivid/vivid-vid-common.h                  |  0
 .../vivid/vivid-vid-out.c                     |  0
 .../vivid/vivid-vid-out.h                     |  0
 68 files changed, 51 insertions(+), 28 deletions(-)
 create mode 100644 drivers/media/test_drivers/Kconfig
 create mode 100644 drivers/media/test_drivers/Makefile
 rename drivers/media/{platform => test_drivers}/vicodec/Kconfig (100%)
 rename drivers/media/{platform => test_drivers}/vicodec/Makefile (100%)
 rename drivers/media/{platform => test_drivers}/vicodec/codec-fwht.c (100%)
 rename drivers/media/{platform => test_drivers}/vicodec/codec-fwht.h (100%)
 rename drivers/media/{platform => test_drivers}/vicodec/codec-v4l2-fwht.c (100%)
 rename drivers/media/{platform => test_drivers}/vicodec/codec-v4l2-fwht.h (100%)
 rename drivers/media/{platform => test_drivers}/vicodec/vicodec-core.c (100%)
 rename drivers/media/{platform => test_drivers}/vim2m.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/Kconfig (100%)
 rename drivers/media/{platform => test_drivers}/vimc/Makefile (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-capture.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-common.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-common.h (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-core.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-debayer.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-scaler.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-sensor.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-streamer.c (100%)
 rename drivers/media/{platform => test_drivers}/vimc/vimc-streamer.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/Kconfig (100%)
 rename drivers/media/{platform => test_drivers}/vivid/Makefile (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-cec.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-cec.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-core.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-core.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-ctrls.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-ctrls.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-kthread-cap.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-kthread-cap.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-kthread-out.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-kthread-out.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-kthread-touch.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-kthread-touch.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-meta-cap.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-meta-cap.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-meta-out.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-meta-out.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-osd.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-osd.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-radio-common.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-radio-common.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-radio-rx.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-radio-rx.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-radio-tx.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-radio-tx.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-rds-gen.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-rds-gen.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-sdr-cap.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-sdr-cap.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-touch-cap.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-touch-cap.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vbi-cap.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vbi-cap.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vbi-gen.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vbi-gen.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vbi-out.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vbi-out.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vid-cap.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vid-cap.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vid-common.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vid-common.h (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vid-out.c (100%)
 rename drivers/media/{platform => test_drivers}/vivid/vivid-vid-out.h (100%)
drivers/media/Kconfig +14 -0
index 72d4f3e0b081..b35c980dcf56 100644
@@ -101,6 +101,19 @@ config MEDIA_PLATFORM_SUPPORT
 
 	  Say Y when you want to be able so see such devices.
 
+config MEDIA_TEST_SUPPORT
+	bool "Test drivers support"
+	help
+	  Those drivers should not be used on production Kernels, but
+	  can be useful on debug ones. It enables several dummy drivers
+	  that simulate a real hardware. Very useful to test userspace
+	  applications and to validate if the subsystem core is doesn't
+	  have regressions.
+
+	  Say Y if you want to use some virtual test driver.
+
+	  In case of doubts, say N.
+
 source "drivers/media/cec/Kconfig"
 
 source "drivers/media/mc/Kconfig"
@@ -180,6 +193,7 @@ source "drivers/media/radio/Kconfig"
 
 if MEDIA_PLATFORM_SUPPORT
 source "drivers/media/platform/Kconfig"
+source "drivers/media/test_drivers/Kconfig"
 source "drivers/media/mmc/Kconfig"
 endif
 
drivers/media/platform/Kconfig +0 -23
index c4178420d2c5..80028337bf00 100644
@@ -529,29 +529,6 @@ config VIDEO_TI_SC
 config VIDEO_TI_CSC
 	tristate
 
-menuconfig V4L_TEST_DRIVERS
-	bool "Media test drivers"
-	depends on MEDIA_CAMERA_SUPPORT
-
-if V4L_TEST_DRIVERS
-
-source "drivers/media/platform/vimc/Kconfig"
-
-source "drivers/media/platform/vivid/Kconfig"
-
-config VIDEO_VIM2M
-	tristate "Virtual Memory-to-Memory Driver"
-	depends on VIDEO_DEV && VIDEO_V4L2
-	select VIDEOBUF2_VMALLOC
-	select V4L2_MEM2MEM_DEV
-	help
-	  This is a virtual test device for the memory-to-memory driver
-	  framework.
-
-source "drivers/media/platform/vicodec/Kconfig"
-
-endif #V4L_TEST_DRIVERS
-
 menuconfig DVB_PLATFORM_DRIVERS
 	bool "DVB platform devices"
 	depends on MEDIA_DIGITAL_TV_SUPPORT
drivers/media/platform/Makefile +0 -5
index d13db96e3015..a0194ef1211f 100644
@@ -14,11 +14,6 @@ obj-$(CONFIG_VIDEO_PXA27x)	+= pxa_camera.o
 
 obj-$(CONFIG_VIDEO_VIU) += fsl-viu.o
 
-obj-$(CONFIG_VIDEO_VIMC)		+= vimc/
-obj-$(CONFIG_VIDEO_VIVID)		+= vivid/
-obj-$(CONFIG_VIDEO_VIM2M)		+= vim2m.o
-obj-$(CONFIG_VIDEO_VICODEC)		+= vicodec/
-
 obj-y	+= ti-vpe/
 
 obj-$(CONFIG_VIDEO_MX2_EMMAPRP)		+= mx2_emmaprp.o
drivers/media/test_drivers/Kconfig new file +28 -0
new file mode 100644
index 000000000000..258a4d36c0d3
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+if MEDIA_TEST_SUPPORT
+
+menuconfig V4L_TEST_DRIVERS
+	bool "V4L test drivers"
+	depends on MEDIA_CAMERA_SUPPORT
+
+if V4L_TEST_DRIVERS
+
+source "drivers/media/test_drivers/vimc/Kconfig"
+
+source "drivers/media/test_drivers/vivid/Kconfig"
+
+config VIDEO_VIM2M
+	tristate "Virtual Memory-to-Memory Driver"
+	depends on VIDEO_DEV && VIDEO_V4L2
+	select VIDEOBUF2_VMALLOC
+	select V4L2_MEM2MEM_DEV
+	help
+	  This is a virtual test device for the memory-to-memory driver
+	  framework.
+
+source "drivers/media/test_drivers/vicodec/Kconfig"
+
+endif #V4L_TEST_DRIVERS
+
+endif #MEDIA_TEST_SUPPORT
drivers/media/test_drivers/Makefile new file +9 -0
new file mode 100644
index 000000000000..74410d3a9f2d
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Makefile for the test drivers.
+#
+
+obj-$(CONFIG_VIDEO_VIMC)		+= vimc/
+obj-$(CONFIG_VIDEO_VIVID)		+= vivid/
+obj-$(CONFIG_VIDEO_VIM2M)		+= vim2m.o
+obj-$(CONFIG_VIDEO_VICODEC)		+= vicodec/
drivers/media/test_drivers/vicodec/Kconfig renamed from drivers/media/platform/vicodec/Kconfig +0 -0
similarity index 100%
rename from drivers/media/platform/vicodec/Kconfig
rename to drivers/media/test_drivers/vicodec/Kconfig
drivers/media/test_drivers/vicodec/Makefile renamed from drivers/media/platform/vicodec/Makefile +0 -0
similarity index 100%
rename from drivers/media/platform/vicodec/Makefile
rename to drivers/media/test_drivers/vicodec/Makefile
drivers/media/test_drivers/vicodec/codec-fwht.c renamed from drivers/media/platform/vicodec/codec-fwht.c +0 -0
similarity index 100%
rename from drivers/media/platform/vicodec/codec-fwht.c
rename to drivers/media/test_drivers/vicodec/codec-fwht.c
drivers/media/test_drivers/vicodec/codec-fwht.h renamed from drivers/media/platform/vicodec/codec-fwht.h +0 -0
similarity index 100%
rename from drivers/media/platform/vicodec/codec-fwht.h
rename to drivers/media/test_drivers/vicodec/codec-fwht.h
drivers/media/test_drivers/vicodec/codec-v4l2-fwht.c renamed from drivers/media/platform/vicodec/codec-v4l2-fwht.c +0 -0
similarity index 100%
rename from drivers/media/platform/vicodec/codec-v4l2-fwht.c
rename to drivers/media/test_drivers/vicodec/codec-v4l2-fwht.c
drivers/media/test_drivers/vicodec/codec-v4l2-fwht.h renamed from drivers/media/platform/vicodec/codec-v4l2-fwht.h +0 -0
similarity index 100%
rename from drivers/media/platform/vicodec/codec-v4l2-fwht.h
rename to drivers/media/test_drivers/vicodec/codec-v4l2-fwht.h
drivers/media/test_drivers/vicodec/vicodec-core.c renamed from drivers/media/platform/vicodec/vicodec-core.c +0 -0
similarity index 100%
rename from drivers/media/platform/vicodec/vicodec-core.c
rename to drivers/media/test_drivers/vicodec/vicodec-core.c
drivers/media/test_drivers/vim2m.c renamed from drivers/media/platform/vim2m.c +0 -0
similarity index 100%
rename from drivers/media/platform/vim2m.c
rename to drivers/media/test_drivers/vim2m.c
drivers/media/test_drivers/vimc/Kconfig renamed from drivers/media/platform/vimc/Kconfig +0 -0
similarity index 100%
rename from drivers/media/platform/vimc/Kconfig
rename to drivers/media/test_drivers/vimc/Kconfig
drivers/media/test_drivers/vimc/Makefile renamed from drivers/media/platform/vimc/Makefile +0 -0
similarity index 100%
rename from drivers/media/platform/vimc/Makefile
rename to drivers/media/test_drivers/vimc/Makefile
drivers/media/test_drivers/vimc/vimc-capture.c renamed from drivers/media/platform/vimc/vimc-capture.c +0 -0
similarity index 100%
rename from drivers/media/platform/vimc/vimc-capture.c
rename to drivers/media/test_drivers/vimc/vimc-capture.c
drivers/media/test_drivers/vimc/vimc-common.c renamed from drivers/media/platform/vimc/vimc-common.c +0 -0
similarity index 100%
rename from drivers/media/platform/vimc/vimc-common.c
rename to drivers/media/test_drivers/vimc/vimc-common.c
drivers/media/test_drivers/vimc/vimc-common.h renamed from drivers/media/platform/vimc/vimc-common.h +0 -0
similarity index 100%
rename from drivers/media/platform/vimc/vimc-common.h
rename to drivers/media/test_drivers/vimc/vimc-common.h
drivers/media/test_drivers/vimc/vimc-core.c renamed from drivers/media/platform/vimc/vimc-core.c +0 -0
similarity index 100%
rename from drivers/media/platform/vimc/vimc-core.c
rename to drivers/media/test_drivers/vimc/vimc-core.c
drivers/media/test_drivers/vimc/vimc-debayer.c renamed from drivers/media/platform/vimc/vimc-debayer.c +0 -0
similarity index 100%
rename from drivers/media/platform/vimc/vimc-debayer.c
rename to drivers/media/test_drivers/vimc/vimc-debayer.c
drivers/media/test_drivers/vimc/vimc-scaler.c renamed from drivers/media/platform/vimc/vimc-scaler.c +0 -0
similarity index 100%
rename from drivers/media/platform/vimc/vimc-scaler.c
rename to drivers/media/test_drivers/vimc/vimc-scaler.c
drivers/media/test_drivers/vimc/vimc-sensor.c renamed from drivers/media/platform/vimc/vimc-sensor.c +0 -0
similarity index 100%
rename from drivers/media/platform/vimc/vimc-sensor.c
rename to drivers/media/test_drivers/vimc/vimc-sensor.c
drivers/media/test_drivers/vimc/vimc-streamer.c renamed from drivers/media/platform/vimc/vimc-streamer.c +0 -0
similarity index 100%
rename from drivers/media/platform/vimc/vimc-streamer.c
rename to drivers/media/test_drivers/vimc/vimc-streamer.c
drivers/media/test_drivers/vimc/vimc-streamer.h renamed from drivers/media/platform/vimc/vimc-streamer.h +0 -0
similarity index 100%
rename from drivers/media/platform/vimc/vimc-streamer.h
rename to drivers/media/test_drivers/vimc/vimc-streamer.h
drivers/media/test_drivers/vivid/Kconfig renamed from drivers/media/platform/vivid/Kconfig +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/Kconfig
rename to drivers/media/test_drivers/vivid/Kconfig
drivers/media/test_drivers/vivid/Makefile renamed from drivers/media/platform/vivid/Makefile +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/Makefile
rename to drivers/media/test_drivers/vivid/Makefile
drivers/media/test_drivers/vivid/vivid-cec.c renamed from drivers/media/platform/vivid/vivid-cec.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-cec.c
rename to drivers/media/test_drivers/vivid/vivid-cec.c
drivers/media/test_drivers/vivid/vivid-cec.h renamed from drivers/media/platform/vivid/vivid-cec.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-cec.h
rename to drivers/media/test_drivers/vivid/vivid-cec.h
drivers/media/test_drivers/vivid/vivid-core.c renamed from drivers/media/platform/vivid/vivid-core.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-core.c
rename to drivers/media/test_drivers/vivid/vivid-core.c
drivers/media/test_drivers/vivid/vivid-core.h renamed from drivers/media/platform/vivid/vivid-core.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-core.h
rename to drivers/media/test_drivers/vivid/vivid-core.h
drivers/media/test_drivers/vivid/vivid-ctrls.c renamed from drivers/media/platform/vivid/vivid-ctrls.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-ctrls.c
rename to drivers/media/test_drivers/vivid/vivid-ctrls.c
drivers/media/test_drivers/vivid/vivid-ctrls.h renamed from drivers/media/platform/vivid/vivid-ctrls.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-ctrls.h
rename to drivers/media/test_drivers/vivid/vivid-ctrls.h
drivers/media/test_drivers/vivid/vivid-kthread-cap.c renamed from drivers/media/platform/vivid/vivid-kthread-cap.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-kthread-cap.c
rename to drivers/media/test_drivers/vivid/vivid-kthread-cap.c
drivers/media/test_drivers/vivid/vivid-kthread-cap.h renamed from drivers/media/platform/vivid/vivid-kthread-cap.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-kthread-cap.h
rename to drivers/media/test_drivers/vivid/vivid-kthread-cap.h
drivers/media/test_drivers/vivid/vivid-kthread-out.c renamed from drivers/media/platform/vivid/vivid-kthread-out.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-kthread-out.c
rename to drivers/media/test_drivers/vivid/vivid-kthread-out.c
drivers/media/test_drivers/vivid/vivid-kthread-out.h renamed from drivers/media/platform/vivid/vivid-kthread-out.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-kthread-out.h
rename to drivers/media/test_drivers/vivid/vivid-kthread-out.h
drivers/media/test_drivers/vivid/vivid-kthread-touch.c renamed from drivers/media/platform/vivid/vivid-kthread-touch.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-kthread-touch.c
rename to drivers/media/test_drivers/vivid/vivid-kthread-touch.c
drivers/media/test_drivers/vivid/vivid-kthread-touch.h renamed from drivers/media/platform/vivid/vivid-kthread-touch.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-kthread-touch.h
rename to drivers/media/test_drivers/vivid/vivid-kthread-touch.h
drivers/media/test_drivers/vivid/vivid-meta-cap.c renamed from drivers/media/platform/vivid/vivid-meta-cap.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-meta-cap.c
rename to drivers/media/test_drivers/vivid/vivid-meta-cap.c
drivers/media/test_drivers/vivid/vivid-meta-cap.h renamed from drivers/media/platform/vivid/vivid-meta-cap.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-meta-cap.h
rename to drivers/media/test_drivers/vivid/vivid-meta-cap.h
drivers/media/test_drivers/vivid/vivid-meta-out.c renamed from drivers/media/platform/vivid/vivid-meta-out.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-meta-out.c
rename to drivers/media/test_drivers/vivid/vivid-meta-out.c
drivers/media/test_drivers/vivid/vivid-meta-out.h renamed from drivers/media/platform/vivid/vivid-meta-out.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-meta-out.h
rename to drivers/media/test_drivers/vivid/vivid-meta-out.h
drivers/media/test_drivers/vivid/vivid-osd.c renamed from drivers/media/platform/vivid/vivid-osd.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-osd.c
rename to drivers/media/test_drivers/vivid/vivid-osd.c
drivers/media/test_drivers/vivid/vivid-osd.h renamed from drivers/media/platform/vivid/vivid-osd.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-osd.h
rename to drivers/media/test_drivers/vivid/vivid-osd.h
drivers/media/test_drivers/vivid/vivid-radio-common.c renamed from drivers/media/platform/vivid/vivid-radio-common.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-radio-common.c
rename to drivers/media/test_drivers/vivid/vivid-radio-common.c
drivers/media/test_drivers/vivid/vivid-radio-common.h renamed from drivers/media/platform/vivid/vivid-radio-common.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-radio-common.h
rename to drivers/media/test_drivers/vivid/vivid-radio-common.h
drivers/media/test_drivers/vivid/vivid-radio-rx.c renamed from drivers/media/platform/vivid/vivid-radio-rx.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-radio-rx.c
rename to drivers/media/test_drivers/vivid/vivid-radio-rx.c
drivers/media/test_drivers/vivid/vivid-radio-rx.h renamed from drivers/media/platform/vivid/vivid-radio-rx.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-radio-rx.h
rename to drivers/media/test_drivers/vivid/vivid-radio-rx.h
drivers/media/test_drivers/vivid/vivid-radio-tx.c renamed from drivers/media/platform/vivid/vivid-radio-tx.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-radio-tx.c
rename to drivers/media/test_drivers/vivid/vivid-radio-tx.c
drivers/media/test_drivers/vivid/vivid-radio-tx.h renamed from drivers/media/platform/vivid/vivid-radio-tx.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-radio-tx.h
rename to drivers/media/test_drivers/vivid/vivid-radio-tx.h
drivers/media/test_drivers/vivid/vivid-rds-gen.c renamed from drivers/media/platform/vivid/vivid-rds-gen.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-rds-gen.c
rename to drivers/media/test_drivers/vivid/vivid-rds-gen.c
drivers/media/test_drivers/vivid/vivid-rds-gen.h renamed from drivers/media/platform/vivid/vivid-rds-gen.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-rds-gen.h
rename to drivers/media/test_drivers/vivid/vivid-rds-gen.h
drivers/media/test_drivers/vivid/vivid-sdr-cap.c renamed from drivers/media/platform/vivid/vivid-sdr-cap.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-sdr-cap.c
rename to drivers/media/test_drivers/vivid/vivid-sdr-cap.c
drivers/media/test_drivers/vivid/vivid-sdr-cap.h renamed from drivers/media/platform/vivid/vivid-sdr-cap.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-sdr-cap.h
rename to drivers/media/test_drivers/vivid/vivid-sdr-cap.h
drivers/media/test_drivers/vivid/vivid-touch-cap.c renamed from drivers/media/platform/vivid/vivid-touch-cap.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-touch-cap.c
rename to drivers/media/test_drivers/vivid/vivid-touch-cap.c
drivers/media/test_drivers/vivid/vivid-touch-cap.h renamed from drivers/media/platform/vivid/vivid-touch-cap.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-touch-cap.h
rename to drivers/media/test_drivers/vivid/vivid-touch-cap.h
drivers/media/test_drivers/vivid/vivid-vbi-cap.c renamed from drivers/media/platform/vivid/vivid-vbi-cap.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-vbi-cap.c
rename to drivers/media/test_drivers/vivid/vivid-vbi-cap.c
drivers/media/test_drivers/vivid/vivid-vbi-cap.h renamed from drivers/media/platform/vivid/vivid-vbi-cap.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-vbi-cap.h
rename to drivers/media/test_drivers/vivid/vivid-vbi-cap.h
drivers/media/test_drivers/vivid/vivid-vbi-gen.c renamed from drivers/media/platform/vivid/vivid-vbi-gen.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-vbi-gen.c
rename to drivers/media/test_drivers/vivid/vivid-vbi-gen.c
drivers/media/test_drivers/vivid/vivid-vbi-gen.h renamed from drivers/media/platform/vivid/vivid-vbi-gen.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-vbi-gen.h
rename to drivers/media/test_drivers/vivid/vivid-vbi-gen.h
drivers/media/test_drivers/vivid/vivid-vbi-out.c renamed from drivers/media/platform/vivid/vivid-vbi-out.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-vbi-out.c
rename to drivers/media/test_drivers/vivid/vivid-vbi-out.c
drivers/media/test_drivers/vivid/vivid-vbi-out.h renamed from drivers/media/platform/vivid/vivid-vbi-out.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-vbi-out.h
rename to drivers/media/test_drivers/vivid/vivid-vbi-out.h
drivers/media/test_drivers/vivid/vivid-vid-cap.c renamed from drivers/media/platform/vivid/vivid-vid-cap.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-vid-cap.c
rename to drivers/media/test_drivers/vivid/vivid-vid-cap.c
drivers/media/test_drivers/vivid/vivid-vid-cap.h renamed from drivers/media/platform/vivid/vivid-vid-cap.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-vid-cap.h
rename to drivers/media/test_drivers/vivid/vivid-vid-cap.h
drivers/media/test_drivers/vivid/vivid-vid-common.c renamed from drivers/media/platform/vivid/vivid-vid-common.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-vid-common.c
rename to drivers/media/test_drivers/vivid/vivid-vid-common.c
drivers/media/test_drivers/vivid/vivid-vid-common.h renamed from drivers/media/platform/vivid/vivid-vid-common.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-vid-common.h
rename to drivers/media/test_drivers/vivid/vivid-vid-common.h
drivers/media/test_drivers/vivid/vivid-vid-out.c renamed from drivers/media/platform/vivid/vivid-vid-out.c +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-vid-out.c
rename to drivers/media/test_drivers/vivid/vivid-vid-out.c
drivers/media/test_drivers/vivid/vivid-vid-out.h renamed from drivers/media/platform/vivid/vivid-vid-out.h +0 -0
similarity index 100%
rename from drivers/media/platform/vivid/vivid-vid-out.h
rename to drivers/media/test_drivers/vivid/vivid-vid-out.h
Signature · 1 line
2.25.1
#39 lore raw

PATCH v4 32/33 media: i2c/Kconfig: reorganize items there

In reply to Mauro Carvalho Chehab

Right now, there are I2C drivers that don't depend on camera support before and after those.

Move the camera support drivers to the end, and add a notice at the "endif", in order to make easier to maintain and to avoid adding extra dependencies at the other i2c/*/Kconfig files.

---
 drivers/media/i2c/Kconfig | 218 +++++++++++++++++++-------------------
 1 file changed, 107 insertions(+), 111 deletions(-)
drivers/media/i2c/Kconfig +107 -111
index 4bc4cfea2f20..efd12bf4f8eb 100644
@@ -581,6 +581,113 @@ config VIDEO_THS8200
 	  To compile this driver as a module, choose M here: the
 	  module will be called ths8200.
 
+comment "Video improvement chips"
+
+config VIDEO_UPD64031A
+	tristate "NEC Electronics uPD64031A Ghost Reduction"
+	depends on VIDEO_V4L2 && I2C
+	help
+	  Support for the NEC Electronics uPD64031A Ghost Reduction
+	  video chip. It is most often found in NTSC TV cards made for
+	  Japan and is used to reduce the 'ghosting' effect that can
+	  be present in analog TV broadcasts.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called upd64031a.
+
+config VIDEO_UPD64083
+	tristate "NEC Electronics uPD64083 3-Dimensional Y/C separation"
+	depends on VIDEO_V4L2 && I2C
+	help
+	  Support for the NEC Electronics uPD64083 3-Dimensional Y/C
+	  separation video chip. It is used to improve the quality of
+	  the colors of a composite signal.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called upd64083.
+
+comment "Audio/Video compression chips"
+
+config VIDEO_SAA6752HS
+	tristate "Philips SAA6752HS MPEG-2 Audio/Video Encoder"
+	depends on VIDEO_V4L2 && I2C
+	select CRC32
+	help
+	  Support for the Philips SAA6752HS MPEG-2 video and MPEG-audio/AC-3
+	  audio encoder with multiplexer.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called saa6752hs.
+
+comment "SDR tuner chips"
+
+config SDR_MAX2175
+	tristate "Maxim 2175 RF to Bits tuner"
+	depends on VIDEO_V4L2 && MEDIA_SDR_SUPPORT && I2C
+	select REGMAP_I2C
+	help
+	  Support for Maxim 2175 tuner. It is an advanced analog/digital
+	  radio receiver with RF-to-Bits front-end designed for SDR solutions.
+
+	  To compile this driver as a module, choose M here; the
+	  module will be called max2175.
+
+comment "Miscellaneous helper chips"
+
+config VIDEO_THS7303
+	tristate "THS7303/53 Video Amplifier"
+	depends on VIDEO_V4L2 && I2C
+	help
+	  Support for TI THS7303/53 video amplifier
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ths7303.
+
+config VIDEO_M52790
+	tristate "Mitsubishi M52790 A/V switch"
+	depends on VIDEO_V4L2 && I2C
+	help
+	 Support for the Mitsubishi M52790 A/V switch.
+
+	 To compile this driver as a module, choose M here: the
+	 module will be called m52790.
+
+config VIDEO_I2C
+	tristate "I2C transport video support"
+	depends on VIDEO_V4L2 && I2C
+	select VIDEOBUF2_VMALLOC
+	imply HWMON
+	help
+	  Enable the I2C transport video support which supports the
+	  following:
+	   * Panasonic AMG88xx Grid-Eye Sensors
+	   * Melexis MLX90640 Thermal Cameras
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called video-i2c
+
+config VIDEO_ST_MIPID02
+	tristate "STMicroelectronics MIPID02 CSI-2 to PARALLEL bridge"
+	depends on I2C && VIDEO_V4L2
+	select MEDIA_CONTROLLER
+	select VIDEO_V4L2_SUBDEV_API
+	select V4L2_FWNODE
+	help
+	  Support for STMicroelectronics MIPID02 CSI-2 to PARALLEL bridge.
+	  It is used to allow usage of CSI-2 sensor with PARALLEL port
+	  controller.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called st-mipid02.
+
+endmenu
+
+#
+# All drivers that are related to Media Camera Support should be here
+#
+
+if MEDIA_CAMERA_SUPPORT
+
 comment "Camera sensor devices"
 
 config VIDEO_APTINA_PLL
@@ -589,12 +696,6 @@ config VIDEO_APTINA_PLL
 config VIDEO_SMIAPP_PLL
 	tristate
 
-#
-# All drivers that are related to Media Camera Support should be here
-#
-
-if MEDIA_CAMERA_SUPPORT
-
 config VIDEO_HI556
 	tristate "Hynix Hi-556 sensor support"
 	depends on I2C && VIDEO_V4L2
@@ -1162,109 +1263,4 @@ config VIDEO_LM3646
 
 endif # MEDIA_CAMERA_SUPPORT
 
-#
-# Other V4L2 drivers that aren't related with Camera support
-#
-
-comment "Video improvement chips"
-
-config VIDEO_UPD64031A
-	tristate "NEC Electronics uPD64031A Ghost Reduction"
-	depends on VIDEO_V4L2 && I2C
-	help
-	  Support for the NEC Electronics uPD64031A Ghost Reduction
-	  video chip. It is most often found in NTSC TV cards made for
-	  Japan and is used to reduce the 'ghosting' effect that can
-	  be present in analog TV broadcasts.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called upd64031a.
-
-config VIDEO_UPD64083
-	tristate "NEC Electronics uPD64083 3-Dimensional Y/C separation"
-	depends on VIDEO_V4L2 && I2C
-	help
-	  Support for the NEC Electronics uPD64083 3-Dimensional Y/C
-	  separation video chip. It is used to improve the quality of
-	  the colors of a composite signal.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called upd64083.
-
-comment "Audio/Video compression chips"
-
-config VIDEO_SAA6752HS
-	tristate "Philips SAA6752HS MPEG-2 Audio/Video Encoder"
-	depends on VIDEO_V4L2 && I2C
-	select CRC32
-	help
-	  Support for the Philips SAA6752HS MPEG-2 video and MPEG-audio/AC-3
-	  audio encoder with multiplexer.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called saa6752hs.
-
-comment "SDR tuner chips"
-
-config SDR_MAX2175
-	tristate "Maxim 2175 RF to Bits tuner"
-	depends on VIDEO_V4L2 && MEDIA_SDR_SUPPORT && I2C
-	select REGMAP_I2C
-	help
-	  Support for Maxim 2175 tuner. It is an advanced analog/digital
-	  radio receiver with RF-to-Bits front-end designed for SDR solutions.
-
-	  To compile this driver as a module, choose M here; the
-	  module will be called max2175.
-
-comment "Miscellaneous helper chips"
-
-config VIDEO_THS7303
-	tristate "THS7303/53 Video Amplifier"
-	depends on VIDEO_V4L2 && I2C
-	help
-	  Support for TI THS7303/53 video amplifier
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called ths7303.
-
-config VIDEO_M52790
-	tristate "Mitsubishi M52790 A/V switch"
-	depends on VIDEO_V4L2 && I2C
-	help
-	 Support for the Mitsubishi M52790 A/V switch.
-
-	 To compile this driver as a module, choose M here: the
-	 module will be called m52790.
-
-config VIDEO_I2C
-	tristate "I2C transport video support"
-	depends on VIDEO_V4L2 && I2C
-	select VIDEOBUF2_VMALLOC
-	imply HWMON
-	help
-	  Enable the I2C transport video support which supports the
-	  following:
-	   * Panasonic AMG88xx Grid-Eye Sensors
-	   * Melexis MLX90640 Thermal Cameras
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called video-i2c
-
-config VIDEO_ST_MIPID02
-	tristate "STMicroelectronics MIPID02 CSI-2 to PARALLEL bridge"
-	depends on I2C && VIDEO_V4L2
-	select MEDIA_CONTROLLER
-	select VIDEO_V4L2_SUBDEV_API
-	select V4L2_FWNODE
-	help
-	  Support for STMicroelectronics MIPID02 CSI-2 to PARALLEL bridge.
-	  It is used to allow usage of CSI-2 sensor with PARALLEL port
-	  controller.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called st-mipid02.
-
-endmenu
-
 endif # VIDEO_V4L2
Signature · 1 line
2.25.1
#8 lore raw

PATCH v4 8/33 media: Kconfig: move drivers-specific TTPCI_EEPROM Kconfig var

In reply to Mauro Carvalho Chehab

This option is used only by av7110 and by an USB driver. As the av7110 is the first DVB hardware, hardly found those days, let's opt to place it at usb/Kconfig, as the driver with needs it might have a longer lifetime.

---
 drivers/media/Kconfig     | 5 -----
 drivers/media/usb/Kconfig | 6 ++++++
 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/media/Kconfig +0 -5
index b35c980dcf56..f37c0c26fa65 100644
@@ -178,11 +178,6 @@ config DVB_NET
 	  You may want to disable the network support on embedded devices. If
 	  unsure say Y.
 
-# This Kconfig option is used by both PCI and USB drivers
-config TTPCI_EEPROM
-	tristate
-	depends on I2C
-
 source "drivers/media/dvb-core/Kconfig"
 
 comment "Media drivers"
drivers/media/usb/Kconfig +6 -0
index e678d3d11467..bf08393e38d1 100644
@@ -1,4 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0-only
+
+# This Kconfig option is also used by the legacy av7110 driver
+config TTPCI_EEPROM
+	tristate
+	depends on I2C
+
 if USB && MEDIA_SUPPORT
 
 menuconfig MEDIA_USB_SUPPORT
Signature · 1 line
2.25.1
#35 lore raw

PATCH v4 28/33 media: Kconfig: place all options under a sub-menu

In reply to Mauro Carvalho Chehab

That should make easier for people setting the media subsystem config options, as they'll be split by the type of functionality that will be enabled.

---
 drivers/media/Kconfig | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)
drivers/media/Kconfig +18 -10
index 9c1de28ef070..c95b534c5d40 100644
@@ -121,12 +121,9 @@ config MEDIA_TEST_SUPPORT
 	  Say Y when you have a software defined radio device.
 endmenu # media device types
 
-comment "Multimedia core features"
 
-#
-# Video4Linux support
-#	Only enables if one of the V4L2 types (ATV, webcam, radio) is selected
-#
+menu "Media core support"
+	visible if !MEDIA_SUPPORT_FILTER
 
 comment "Video4Linux core enabled to support hybrid TV devices"
 	depends on MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI
@@ -135,6 +132,9 @@ config VIDEO_DEV
 	tristate
 	prompt "Video4Linux core" if !(MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI)
 	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT || MEDIA_PLATFORM_SUPPORT || MEDIA_TEST_SUPPORT || MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI
+	help
+	  Enables the V4L2 API, used by cameras, analog TV, video grabbers,
+	  radio devices and by some input devices.
 
 config MEDIA_CONTROLLER
 	bool "Media Controller API"
@@ -158,20 +158,24 @@ config DVB_CORE
 	prompt "Digital TV core"  if !(MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI)
 	depends on MEDIA_DIGITAL_TV_SUPPORT
 	depends on (I2C || I2C=n)
-	default y
 	select CRC32
-
 	help
+	  Enables the DVB API, used by Digital TV devices. Supports several
+	  standards, including DVB, ATSC, ISDB and CMDB.
 
+endmenu # Media core support
 
+#
+# Extra per-media API core functionality
 
-
+menu "Media core additional options"
 source "drivers/media/v4l2-core/Kconfig"
 source "drivers/media/mc/Kconfig"
 source "drivers/media/dvb-core/Kconfig"
 source "drivers/media/cec/Kconfig"
+endmenu
 
-comment "Media drivers"
+menu "Media drivers"
 
 comment "Drivers filtered as selected at 'Filter media drivers'"
 	depends on MEDIA_SUPPORT_FILTER
@@ -191,7 +195,9 @@ endif
 
 source "drivers/media/firewire/Kconfig"
 
-comment "Media ancillary drivers (tuners, sensors, i2c, spi, frontends)"
+endmenu
+
+menu "Media ancillary drivers (tuners, sensors, i2c, spi, frontends)"
 
 #
 # Ancillary drivers (tuners, i2c, spi, frontends)
@@ -236,4 +242,6 @@ source "drivers/media/spi/Kconfig"
 source "drivers/media/tuners/Kconfig"
 source "drivers/media/dvb-frontends/Kconfig"
 
+endmenu
+
 endif # MEDIA_SUPPORT
Signature · 1 line
2.25.1
#27 lore raw

PATCH v4 20/33 media: Kconfig: reorganize the drivers menu options

In reply to Mauro Carvalho Chehab

The comments before some of the drivers support look weird, because their Kconfig have their own "comment" directive inside it. So, rearrange them to make it look a little nicer for the ones with are not too familiar with the media system.

---
 drivers/media/Kconfig | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/media/Kconfig +7 -8
index 9c32616f863a..b1a6874acbcc 100644
@@ -104,9 +104,7 @@ config MEDIA_TEST_SUPPORT
 
 	  In case of doubts, say N.
 
-source "drivers/media/cec/Kconfig"
-
-source "drivers/media/mc/Kconfig"
+comment "Multimedia core features"
 
 #
 # Video4Linux support
@@ -130,8 +128,6 @@ config VIDEO_V4L2_SUBDEV_API
 
 	  This API is mostly used by camera interfaces in embedded platforms.
 
-source "drivers/media/v4l2-core/Kconfig"
-
 #
 # DVB Core
 #	Only enables if one of DTV is selected
@@ -174,7 +170,10 @@ config DVB_NET
 	  You may want to disable the network support on embedded devices. If
 	  unsure say Y.
 
+source "drivers/media/v4l2-core/Kconfig"
+source "drivers/media/mc/Kconfig"
 source "drivers/media/dvb-core/Kconfig"
+source "drivers/media/cec/Kconfig"
 
 comment "Media drivers"
 
@@ -182,6 +181,9 @@ source "drivers/media/usb/Kconfig"
 source "drivers/media/pci/Kconfig"
 source "drivers/media/radio/Kconfig"
 
+# Common driver options
+source "drivers/media/common/Kconfig"
+
 if MEDIA_PLATFORM_SUPPORT
 source "drivers/media/platform/Kconfig"
 source "drivers/media/test_drivers/Kconfig"
@@ -190,9 +192,6 @@ endif
 
 source "drivers/media/firewire/Kconfig"
 
-# Common driver options
-source "drivers/media/common/Kconfig"
-
 comment "Media ancillary drivers (tuners, sensors, i2c, spi, frontends)"
 
 #
Signature · 1 line
2.25.1
#33 lore raw

PATCH v4 26/33 media: Kconfig: move V4L2 subdev API to v4l2-core/Kconfig

In reply to Mauro Carvalho Chehab

This option is part of V4L2 API extra functionality set. Move it to be at the v4l2-core/Kconfig, where it belongs, cleaning the main Kconfig file.

---
 drivers/media/Kconfig           | 9 ---------
 drivers/media/v4l2-core/Kconfig | 9 +++++++++
 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/media/Kconfig +0 -9
index dda449556f22..f14b583c9ee1 100644
@@ -136,15 +136,6 @@ config VIDEO_DEV
 	prompt "Video4Linux core" if !(MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI)
 	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT || MEDIA_PLATFORM_SUPPORT || MEDIA_TEST_SUPPORT || MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI
 
-config VIDEO_V4L2_SUBDEV_API
-	bool "V4L2 sub-device userspace API"
-	depends on VIDEO_DEV && MEDIA_CONTROLLER
-	help
-	  Enables the V4L2 sub-device pad-level userspace API used to configure
-	  video format, size and frame rate between hardware blocks.
-
-	  This API is mostly used by camera interfaces in embedded platforms.
-
 #
 # DVB Core
 #	Only enables if one of DTV is selected
drivers/media/v4l2-core/Kconfig +9 -0
index 26276b257eae..33aa7fe571f8 100644
@@ -16,6 +16,15 @@ config VIDEO_V4L2_I2C
 	depends on I2C && VIDEO_V4L2
 	default y
 
+config VIDEO_V4L2_SUBDEV_API
+	bool "V4L2 sub-device userspace API"
+	depends on VIDEO_DEV && MEDIA_CONTROLLER
+	help
+	  Enables the V4L2 sub-device pad-level userspace API used to configure
+	  video format, size and frame rate between hardware blocks.
+
+	  This API is mostly used by camera interfaces in embedded platforms.
+
 config VIDEO_ADV_DEBUG
 	bool "Enable advanced debug functionality on V4L2 drivers"
 	help
Signature · 1 line
2.25.1
#11 lore raw

PATCH v4 11/33 media: ddbridge-dummy_fe: do some vars and function renames

In reply to Mauro Carvalho Chehab

As the name of this driver is now ddbridge-dummy, do some renames internally.

No functional changes.

---
 .../media/pci/ddbridge/ddbridge-dummy-fe.c    | 144 +++++++++---------
 .../media/pci/ddbridge/ddbridge-dummy-fe.h    |  22 +--
 2 files changed, 83 insertions(+), 83 deletions(-)
drivers/media/pci/ddbridge/ddbridge-dummy-fe.c +72 -72
index 9ff1ebaa5e04..ebf4d9c30a55 100644
@@ -11,15 +11,15 @@
 #include <linux/slab.h>
 
 #include <media/dvb_frontend.h>
-#include "dvb_dummy_fe.h"
+#include "ddbridge-dummy-fe.h"
 
 
-struct dvb_dummy_fe_state {
+struct ddbridge_dummy_fe_state {
 	struct dvb_frontend frontend;
 };
 
 
-static int dvb_dummy_fe_read_status(struct dvb_frontend *fe,
+static int ddbridge_dummy_fe_read_status(struct dvb_frontend *fe,
 				    enum fe_status *status)
 {
 	*status = FE_HAS_SIGNAL
@@ -31,26 +31,26 @@ static int dvb_dummy_fe_read_status(struct dvb_frontend *fe,
 	return 0;
 }
 
-static int dvb_dummy_fe_read_ber(struct dvb_frontend *fe, u32 *ber)
+static int ddbridge_dummy_fe_read_ber(struct dvb_frontend *fe, u32 *ber)
 {
 	*ber = 0;
 	return 0;
 }
 
-static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe,
+static int ddbridge_dummy_fe_read_signal_strength(struct dvb_frontend *fe,
 					     u16 *strength)
 {
 	*strength = 0;
 	return 0;
 }
 
-static int dvb_dummy_fe_read_snr(struct dvb_frontend *fe, u16 *snr)
+static int ddbridge_dummy_fe_read_snr(struct dvb_frontend *fe, u16 *snr)
 {
 	*snr = 0;
 	return 0;
 }
 
-static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
+static int ddbridge_dummy_fe_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
 {
 	*ucblocks = 0;
 	return 0;
@@ -61,13 +61,13 @@ static int dvb_dummy_fe_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
  * Also, it should check for the locks, in order to avoid report wrong data
  * to userspace.
  */
-static int dvb_dummy_fe_get_frontend(struct dvb_frontend *fe,
+static int ddbridge_dummy_fe_get_frontend(struct dvb_frontend *fe,
 				     struct dtv_frontend_properties *p)
 {
 	return 0;
 }
 
-static int dvb_dummy_fe_set_frontend(struct dvb_frontend *fe)
+static int ddbridge_dummy_fe_set_frontend(struct dvb_frontend *fe)
 {
 	if (fe->ops.tuner_ops.set_params) {
 		fe->ops.tuner_ops.set_params(fe);
@@ -78,102 +78,102 @@ static int dvb_dummy_fe_set_frontend(struct dvb_frontend *fe)
 	return 0;
 }
 
-static int dvb_dummy_fe_sleep(struct dvb_frontend *fe)
+static int ddbridge_dummy_fe_sleep(struct dvb_frontend *fe)
 {
 	return 0;
 }
 
-static int dvb_dummy_fe_init(struct dvb_frontend *fe)
+static int ddbridge_dummy_fe_init(struct dvb_frontend *fe)
 {
 	return 0;
 }
 
-static int dvb_dummy_fe_set_tone(struct dvb_frontend *fe,
+static int ddbridge_dummy_fe_set_tone(struct dvb_frontend *fe,
 				 enum fe_sec_tone_mode tone)
 {
 	return 0;
 }
 
-static int dvb_dummy_fe_set_voltage(struct dvb_frontend *fe,
+static int ddbridge_dummy_fe_set_voltage(struct dvb_frontend *fe,
 				    enum fe_sec_voltage voltage)
 {
 	return 0;
 }
 
-static void dvb_dummy_fe_release(struct dvb_frontend *fe)
+static void ddbridge_dummy_fe_release(struct dvb_frontend *fe)
 {
-	struct dvb_dummy_fe_state *state = fe->demodulator_priv;
+	struct ddbridge_dummy_fe_state *state = fe->demodulator_priv;
 
 	kfree(state);
 }
 
-static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops;
+static const struct dvb_frontend_ops ddbridge_dummy_fe_ofdm_ops;
 
-struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void)
+struct dvb_frontend *ddbridge_dummy_fe_ofdm_attach(void)
 {
-	struct dvb_dummy_fe_state *state = NULL;
+	struct ddbridge_dummy_fe_state *state = NULL;
 
 	/* allocate memory for the internal state */
-	state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
+	state = kzalloc(sizeof(struct ddbridge_dummy_fe_state), GFP_KERNEL);
 	if (!state)
 		return NULL;
 
 	/* create dvb_frontend */
 	memcpy(&state->frontend.ops,
-	       &dvb_dummy_fe_ofdm_ops,
+	       &ddbridge_dummy_fe_ofdm_ops,
 	       sizeof(struct dvb_frontend_ops));
 
 	state->frontend.demodulator_priv = state;
 	return &state->frontend;
 }
-EXPORT_SYMBOL(dvb_dummy_fe_ofdm_attach);
+EXPORT_SYMBOL(ddbridge_dummy_fe_ofdm_attach);
 
-static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops;
+static const struct dvb_frontend_ops ddbridge_dummy_fe_qpsk_ops;
 
-struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
+struct dvb_frontend *ddbridge_dummy_fe_qpsk_attach(void)
 {
-	struct dvb_dummy_fe_state *state = NULL;
+	struct ddbridge_dummy_fe_state *state = NULL;
 
 	/* allocate memory for the internal state */
-	state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
+	state = kzalloc(sizeof(struct ddbridge_dummy_fe_state), GFP_KERNEL);
 	if (!state)
 		return NULL;
 
 	/* create dvb_frontend */
 	memcpy(&state->frontend.ops,
-	       &dvb_dummy_fe_qpsk_ops,
+	       &ddbridge_dummy_fe_qpsk_ops,
 	       sizeof(struct dvb_frontend_ops));
 
 	state->frontend.demodulator_priv = state;
 	return &state->frontend;
 }
-EXPORT_SYMBOL(dvb_dummy_fe_qpsk_attach);
+EXPORT_SYMBOL(ddbridge_dummy_fe_qpsk_attach);
 
-static const struct dvb_frontend_ops dvb_dummy_fe_qam_ops;
+static const struct dvb_frontend_ops ddbridge_dummy_fe_qam_ops;
 
-struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
+struct dvb_frontend *ddbridge_dummy_fe_qam_attach(void)
 {
-	struct dvb_dummy_fe_state *state = NULL;
+	struct ddbridge_dummy_fe_state *state = NULL;
 
 	/* allocate memory for the internal state */
-	state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
+	state = kzalloc(sizeof(struct ddbridge_dummy_fe_state), GFP_KERNEL);
 	if (!state)
 		return NULL;
 
 	/* create dvb_frontend */
 	memcpy(&state->frontend.ops,
-	       &dvb_dummy_fe_qam_ops,
+	       &ddbridge_dummy_fe_qam_ops,
 	       sizeof(struct dvb_frontend_ops));
 
 	state->frontend.demodulator_priv = state;
 	return &state->frontend;
 }
-EXPORT_SYMBOL(dvb_dummy_fe_qam_attach);
+EXPORT_SYMBOL(ddbridge_dummy_fe_qam_attach);
 
-static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
+static const struct dvb_frontend_ops ddbridge_dummy_fe_ofdm_ops = {
 	.delsys = { SYS_DVBT },
 	.info = {
-		.name			= "Dummy DVB-T",
+		.name			= "ddbridge dummy DVB-T",
 		.frequency_min_hz	= 0,
 		.frequency_max_hz	= 863250 * kHz,
 		.frequency_stepsize_hz	= 62500,
@@ -194,25 +194,25 @@ static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
 			FE_CAN_HIERARCHY_AUTO,
 	},
 
-	.release = dvb_dummy_fe_release,
+	.release = ddbridge_dummy_fe_release,
 
-	.init = dvb_dummy_fe_init,
-	.sleep = dvb_dummy_fe_sleep,
+	.init = ddbridge_dummy_fe_init,
+	.sleep = ddbridge_dummy_fe_sleep,
 
-	.set_frontend = dvb_dummy_fe_set_frontend,
-	.get_frontend = dvb_dummy_fe_get_frontend,
+	.set_frontend = ddbridge_dummy_fe_set_frontend,
+	.get_frontend = ddbridge_dummy_fe_get_frontend,
 
-	.read_status = dvb_dummy_fe_read_status,
-	.read_ber = dvb_dummy_fe_read_ber,
-	.read_signal_strength = dvb_dummy_fe_read_signal_strength,
-	.read_snr = dvb_dummy_fe_read_snr,
-	.read_ucblocks = dvb_dummy_fe_read_ucblocks,
+	.read_status = ddbridge_dummy_fe_read_status,
+	.read_ber = ddbridge_dummy_fe_read_ber,
+	.read_signal_strength = ddbridge_dummy_fe_read_signal_strength,
+	.read_snr = ddbridge_dummy_fe_read_snr,
+	.read_ucblocks = ddbridge_dummy_fe_read_ucblocks,
 };
 
-static const struct dvb_frontend_ops dvb_dummy_fe_qam_ops = {
+static const struct dvb_frontend_ops ddbridge_dummy_fe_qam_ops = {
 	.delsys = { SYS_DVBC_ANNEX_A },
 	.info = {
-		.name			= "Dummy DVB-C",
+		.name			= "ddbridge dummy DVB-C",
 		.frequency_min_hz	=  51 * MHz,
 		.frequency_max_hz	= 858 * MHz,
 		.frequency_stepsize_hz	= 62500,
@@ -228,25 +228,25 @@ static const struct dvb_frontend_ops dvb_dummy_fe_qam_ops = {
 			FE_CAN_INVERSION_AUTO
 	},
 
-	.release = dvb_dummy_fe_release,
+	.release = ddbridge_dummy_fe_release,
 
-	.init = dvb_dummy_fe_init,
-	.sleep = dvb_dummy_fe_sleep,
+	.init = ddbridge_dummy_fe_init,
+	.sleep = ddbridge_dummy_fe_sleep,
 
-	.set_frontend = dvb_dummy_fe_set_frontend,
-	.get_frontend = dvb_dummy_fe_get_frontend,
+	.set_frontend = ddbridge_dummy_fe_set_frontend,
+	.get_frontend = ddbridge_dummy_fe_get_frontend,
 
-	.read_status = dvb_dummy_fe_read_status,
-	.read_ber = dvb_dummy_fe_read_ber,
-	.read_signal_strength = dvb_dummy_fe_read_signal_strength,
-	.read_snr = dvb_dummy_fe_read_snr,
-	.read_ucblocks = dvb_dummy_fe_read_ucblocks,
+	.read_status = ddbridge_dummy_fe_read_status,
+	.read_ber = ddbridge_dummy_fe_read_ber,
+	.read_signal_strength = ddbridge_dummy_fe_read_signal_strength,
+	.read_snr = ddbridge_dummy_fe_read_snr,
+	.read_ucblocks = ddbridge_dummy_fe_read_ucblocks,
 };
 
-static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = {
+static const struct dvb_frontend_ops ddbridge_dummy_fe_qpsk_ops = {
 	.delsys = { SYS_DVBS },
 	.info = {
-		.name			= "Dummy DVB-S",
+		.name			= "ddbridge dummy DVB-S",
 		.frequency_min_hz	=  950 * MHz,
 		.frequency_max_hz	= 2150 * MHz,
 		.frequency_stepsize_hz	= 250 * kHz,
@@ -263,24 +263,24 @@ static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = {
 			FE_CAN_QPSK
 	},
 
-	.release = dvb_dummy_fe_release,
+	.release = ddbridge_dummy_fe_release,
 
-	.init = dvb_dummy_fe_init,
-	.sleep = dvb_dummy_fe_sleep,
+	.init = ddbridge_dummy_fe_init,
+	.sleep = ddbridge_dummy_fe_sleep,
 
-	.set_frontend = dvb_dummy_fe_set_frontend,
-	.get_frontend = dvb_dummy_fe_get_frontend,
+	.set_frontend = ddbridge_dummy_fe_set_frontend,
+	.get_frontend = ddbridge_dummy_fe_get_frontend,
 
-	.read_status = dvb_dummy_fe_read_status,
-	.read_ber = dvb_dummy_fe_read_ber,
-	.read_signal_strength = dvb_dummy_fe_read_signal_strength,
-	.read_snr = dvb_dummy_fe_read_snr,
-	.read_ucblocks = dvb_dummy_fe_read_ucblocks,
+	.read_status = ddbridge_dummy_fe_read_status,
+	.read_ber = ddbridge_dummy_fe_read_ber,
+	.read_signal_strength = ddbridge_dummy_fe_read_signal_strength,
+	.read_snr = ddbridge_dummy_fe_read_snr,
+	.read_ucblocks = ddbridge_dummy_fe_read_ucblocks,
 
-	.set_voltage = dvb_dummy_fe_set_voltage,
-	.set_tone = dvb_dummy_fe_set_tone,
+	.set_voltage = ddbridge_dummy_fe_set_voltage,
+	.set_tone = ddbridge_dummy_fe_set_tone,
 };
 
-MODULE_DESCRIPTION("DVB DUMMY Frontend");
+MODULE_DESCRIPTION("ddbridge dummy Frontend");
 MODULE_AUTHOR("Emard");
 MODULE_LICENSE("GPL");
drivers/media/pci/ddbridge/ddbridge-dummy-fe.h +11 -11
index 463abf5ebd56..811c203539e2 100644
@@ -5,32 +5,32 @@
  *  Written by Emard <[email protected]>
  */
 
-#ifndef DVB_DUMMY_FE_H
-#define DVB_DUMMY_FE_H
+#ifndef DDBRIDGE_DUMMY_FE_H
+#define DDBRIDGE_DUMMY_FE_H
 
 #include <linux/dvb/frontend.h>
 #include <media/dvb_frontend.h>
 
-#if IS_REACHABLE(CONFIG_DVB_DUMMY_FE)
-struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void);
-struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void);
-struct dvb_frontend *dvb_dummy_fe_qam_attach(void);
+#if IS_REACHABLE(CONFIG_DDBRIDGE_DUMMY_FE)
+struct dvb_frontend *ddbridge_dummy_fe_ofdm_attach(void);
+struct dvb_frontend *ddbridge_dummy_fe_qpsk_attach(void);
+struct dvb_frontend *ddbridge_dummy_fe_qam_attach(void);
 #else
-static inline struct dvb_frontend *dvb_dummy_fe_ofdm_attach(void)
+static inline struct dvb_frontend *ddbridge_dummy_fe_ofdm_attach(void)
 {
 	pr_warn("%s: driver disabled by Kconfig\n", __func__);
 	return NULL;
 }
-static inline struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
+static inline struct dvb_frontend *ddbridge_dummy_fe_qpsk_attach(void)
 {
 	pr_warn("%s: driver disabled by Kconfig\n", __func__);
 	return NULL;
 }
-static inline struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
+static inline struct dvb_frontend *ddbridge_dummy_fe_qam_attach(void)
 {
 	pr_warn("%s: driver disabled by Kconfig\n", __func__);
 	return NULL;
 }
-#endif /* CONFIG_DVB_DUMMY_FE */
+#endif /* CONFIG_DDBRIDGE_DUMMY_FE */
 
-#endif // DVB_DUMMY_FE_H
+#endif // DDBRIDGE_DUMMY_FE_H
Signature · 1 line
2.25.1
#34 lore raw

PATCH v4 27/33 media: Kconfig: move media controller core select to main Kconfig

In reply to Mauro Carvalho Chehab

Let's place the main API selections at the media/Kconfig file, as this way we can better organize things.

---
 drivers/media/Kconfig    | 9 +++++++++
 drivers/media/mc/Kconfig | 9 ---------
 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/media/Kconfig +9 -0
index f14b583c9ee1..9c1de28ef070 100644
@@ -136,6 +136,15 @@ config VIDEO_DEV
 	prompt "Video4Linux core" if !(MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI)
 	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT || MEDIA_PLATFORM_SUPPORT || MEDIA_TEST_SUPPORT || MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI
 
+config MEDIA_CONTROLLER
+	bool "Media Controller API"
+	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_PLATFORM_SUPPORT
+	help
+	  Enable the media controller API used to query media devices internal
+	  topology and configure it dynamically.
+
+	  This API is mostly used by camera interfaces in embedded platforms.
+
 #
 # DVB Core
 #	Only enables if one of DTV is selected
drivers/media/mc/Kconfig +0 -9
index e740ace54d7f..002a918c4c75 100644
@@ -5,15 +5,6 @@
 #	Selectable only for webcam/grabbers, as other drivers don't use it
 #
 
-config MEDIA_CONTROLLER
-	bool "Media Controller API"
-	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_PLATFORM_SUPPORT
-	help
-	  Enable the media controller API used to query media devices internal
-	  topology and configure it dynamically.
-
-	  This API is mostly used by camera interfaces in embedded platforms.
-
 config MEDIA_CONTROLLER_DVB
 	bool "Enable Media controller for DVB (EXPERIMENTAL)"
 	depends on MEDIA_CONTROLLER && DVB_CORE
Signature · 1 line
2.25.1
#15 lore raw

PATCH v4 15/33 media: Kconfig: better support hybrid TV devices

In reply to Mauro Carvalho Chehab

Right now, if one has an hybrid TV card, it has to select both analog and digital TV support, as otherwise the needed core support won't be selected.

Change the logic to auto-select the core support for those drivers, as this is a way more intuitive.

It should be noticed that, as now both DVB_CORE and VIDEO_DEV defaults depends on selecting a hybrid cards, we had to remove the explicit dependencies there, in order to avoid circular dependencies.

That requires some tricks:

1) the prompt should not be not visible when an hybrid card is selected, as the user shold not change it.

2) When a media hybrid device is selected, the modular option for DVB_CORE and VIDEO_DEV will follow the MEDIA_SUPPORT dependency, as we can't have a core built with "y" with a driver built as module.

Note: while here, moved two pure V4L2 PCI drivers out of the "hybrid" part of config and consider pvrusb2 as an hybrid device.

---
 drivers/media/Kconfig             | 24 +++++++++++-------------
 drivers/media/pci/Kconfig         | 11 +++++++++--
 drivers/media/pci/bt8xx/Kconfig   |  5 ++---
 drivers/media/pci/cx18/Kconfig    |  2 +-
 drivers/media/pci/cx23885/Kconfig |  4 ++--
 drivers/media/pci/cx88/Kconfig    |  4 ++--
 drivers/media/pci/saa7134/Kconfig |  4 ++--
 drivers/media/pci/saa7164/Kconfig |  2 +-
 drivers/media/platform/Kconfig    |  2 +-
 drivers/media/usb/Kconfig         |  8 +++++++-
 drivers/media/usb/au0828/Kconfig  |  6 ++----
 drivers/media/usb/cx231xx/Kconfig |  4 ++--
 drivers/media/usb/pvrusb2/Kconfig |  4 ++--
 drivers/media/usb/tm6000/Kconfig  |  4 ++--
 14 files changed, 46 insertions(+), 38 deletions(-)
drivers/media/Kconfig +11 -13
index f6763d02f1be..f400370b2928 100644
@@ -44,20 +44,14 @@ config MEDIA_ANALOG_TV_SUPPORT
 	help
 	  Enable analog TV support.
 
-	  Say Y when you have a TV board with analog support or with a
-	  hybrid analog/digital TV chipset.
-
-	  Note: There are several DVB cards that are based on chips that
-		support both analog and digital TV. Disabling this option
-		will disable support for them.
+	  Say Y when you have a board with analog TV support.
 
 config MEDIA_DIGITAL_TV_SUPPORT
 	bool "Digital TV support"
 	help
 	  Enable digital TV support.
 
-	  Say Y when you have a board with digital support or a board with
-	  hybrid digital TV and analog TV.
+	  Say Y when you have a board with digital TV support.
 
 config MEDIA_RADIO_SUPPORT
 	bool "AM/FM radio receivers/transmitters support"
@@ -69,10 +63,6 @@ config MEDIA_RADIO_SUPPORT
 
 	  Say Y when you have a board with radio support.
 
-	  Note: There are several TV cards that are based on chips that
-		support radio reception. Disabling this option will
-		disable support for them.
-
 config MEDIA_SDR_SUPPORT
 	bool "Software defined radio support"
 	help
@@ -123,9 +113,13 @@ source "drivers/media/mc/Kconfig"
 #	Only enables if one of the V4L2 types (ATV, webcam, radio) is selected
 #
 
+comment "Video4Linux core enabled to support hybrid TV devices"
+	depends on MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI
+
 config VIDEO_DEV
 	tristate
-	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT || MEDIA_PLATFORM_SUPPORT
+	prompt "Video4Linux core" if !(MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI)
+	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT || MEDIA_PLATFORM_SUPPORT || MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI
 
 config VIDEO_V4L2_SUBDEV_API
 	bool "V4L2 sub-device userspace API"
@@ -143,8 +137,12 @@ source "drivers/media/v4l2-core/Kconfig"
 #	Only enables if one of DTV is selected
 #
 
+comment "Digital TV core enabled to support hybrid TV devices"
+	depends on MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI
+
 config DVB_CORE
 	tristate
+	prompt "Digital TV core"  if !(MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI)
 	depends on MEDIA_DIGITAL_TV_SUPPORT
 	depends on (I2C || I2C=n)
 	default y
drivers/media/pci/Kconfig +9 -2
index e576283ebbf5..348da044ec78 100644
@@ -1,4 +1,11 @@
 # SPDX-License-Identifier: GPL-2.0-only
+
+# Should match the hybrid card list below
+config MEDIA_HYBRID_PCI
+	bool
+	depends on VIDEO_CX18 || VIDEO_CX23885 || VIDEO_CX88 || VIDEO_BT848 || VIDEO_SAA7134 || VIDEO_SAA7164
+	default y
+
 if PCI && MEDIA_SUPPORT
 
 menuconfig MEDIA_PCI_SUPPORT
@@ -24,18 +31,18 @@ if MEDIA_ANALOG_TV_SUPPORT
 source "drivers/media/pci/ivtv/Kconfig"
 source "drivers/media/pci/saa7146/Kconfig"
 source "drivers/media/pci/dt3155/Kconfig"
+source "drivers/media/pci/cx25821/Kconfig"
+source "drivers/media/pci/cobalt/Kconfig"
 endif
 
 if MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT
 	comment "Media capture/analog/hybrid TV support"
 source "drivers/media/pci/cx18/Kconfig"
 source "drivers/media/pci/cx23885/Kconfig"
-source "drivers/media/pci/cx25821/Kconfig"
 source "drivers/media/pci/cx88/Kconfig"
 source "drivers/media/pci/bt8xx/Kconfig"
 source "drivers/media/pci/saa7134/Kconfig"
 source "drivers/media/pci/saa7164/Kconfig"
-source "drivers/media/pci/cobalt/Kconfig"
 
 endif
 
drivers/media/pci/bt8xx/Kconfig +2 -3
index 75d172a6f54c..c79c6175c262 100644
@@ -1,11 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_BT848
 	tristate "BT848 Video For Linux"
-	depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2
+	depends on PCI && I2C
 	select I2C_ALGOBIT
 	select VIDEOBUF_DMA_SG
 	depends on RC_CORE
-	depends on MEDIA_RADIO_SUPPORT
 	select VIDEO_TUNER
 	select VIDEO_TVEEPROM
 	select VIDEO_MSP3400 if MEDIA_SUBDRV_AUTOSELECT
@@ -24,7 +23,7 @@ config VIDEO_BT848
 
 config DVB_BT8XX
 	tristate "DVB/ATSC Support for bt878 based TV cards"
-	depends on DVB_CORE && PCI && I2C && VIDEO_BT848
+	depends on PCI && I2C && VIDEO_BT848
 	select DVB_MT352 if MEDIA_SUBDRV_AUTOSELECT
 	select DVB_SP887X if MEDIA_SUBDRV_AUTOSELECT
 	select DVB_NXT6000 if MEDIA_SUBDRV_AUTOSELECT
drivers/media/pci/cx18/Kconfig +1 -1
index 7074a1071302..110e072bd8ba 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_CX18
 	tristate "Conexant cx23418 MPEG encoder support"
-	depends on VIDEO_V4L2 && DVB_CORE && PCI && I2C
+	depends on PCI && I2C
 	select I2C_ALGOBIT
 	select VIDEOBUF_VMALLOC
 	depends on RC_CORE
drivers/media/pci/cx23885/Kconfig +2 -2
index 926da881929d..e8f4edf270c8 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_CX23885
 	tristate "Conexant cx23885 (2388x successor) support"
-	depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT && SND
+	depends on PCI && I2C && INPUT && SND
 	select SND_PCM
 	select I2C_ALGOBIT
 	select VIDEO_TUNER
@@ -53,7 +53,7 @@ config VIDEO_CX23885
 
 config MEDIA_ALTERA_CI
 	tristate "Altera FPGA based CI module"
-	depends on VIDEO_CX23885 && DVB_CORE
+	depends on VIDEO_CX23885
 	select ALTERA_STAPL
 	help
 	  An Altera FPGA CI module for NetUP Dual DVB-T/C RF CI card.
drivers/media/pci/cx88/Kconfig +2 -2
index 24e1e7c41744..ab994b3049f4 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_CX88
 	tristate "Conexant 2388x (bt878 successor) support"
-	depends on VIDEO_DEV && PCI && I2C && RC_CORE
+	depends on PCI && I2C && RC_CORE
 	select I2C_ALGOBIT
 	select VIDEOBUF2_DMA_SG
 	select VIDEO_TUNER
@@ -44,7 +44,7 @@ config VIDEO_CX88_BLACKBIRD
 
 config VIDEO_CX88_DVB
 	tristate "DVB/ATSC Support for cx2388x based TV cards"
-	depends on VIDEO_CX88 && DVB_CORE
+	depends on VIDEO_CX88
 	select VIDEOBUF2_DVB
 	select DVB_PLL if MEDIA_SUBDRV_AUTOSELECT
 	select DVB_MT352 if MEDIA_SUBDRV_AUTOSELECT
drivers/media/pci/saa7134/Kconfig +2 -2
index 30c1759682a9..a2af02f6d593 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_SAA7134
 	tristate "Philips SAA7134 support"
-	depends on VIDEO_DEV && PCI && I2C
+	depends on PCI && I2C
 	select VIDEOBUF2_DMA_SG
 	select VIDEO_TUNER
 	select VIDEO_TVEEPROM
@@ -37,7 +37,7 @@ config VIDEO_SAA7134_RC
 
 config VIDEO_SAA7134_DVB
 	tristate "DVB/ATSC Support for saa7134 based TV cards"
-	depends on VIDEO_SAA7134 && DVB_CORE
+	depends on VIDEO_SAA7134
 	select VIDEOBUF2_DVB
 	select DVB_PLL if MEDIA_SUBDRV_AUTOSELECT
 	select DVB_MT352 if MEDIA_SUBDRV_AUTOSELECT
drivers/media/pci/saa7164/Kconfig +1 -1
index 6655c3e504cd..8df933a722a7 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_SAA7164
 	tristate "NXP SAA7164 support"
-	depends on DVB_CORE && VIDEO_DEV && PCI && I2C
+	depends on PCI && I2C
 	select I2C_ALGOBIT
 	select FW_LOADER
 	select VIDEO_TUNER
drivers/media/platform/Kconfig +1 -1
index 80028337bf00..6b693cd0576e 100644
@@ -531,7 +531,7 @@ config VIDEO_TI_CSC
 
 menuconfig DVB_PLATFORM_DRIVERS
 	bool "DVB platform devices"
-	depends on MEDIA_DIGITAL_TV_SUPPORT
+	select DVB_CORE
 	help
 	  Say Y here to enable support for platform-specific Digital TV drivers.
 
drivers/media/usb/Kconfig +7 -1
index bf08393e38d1..036aa4385fdc 100644
@@ -5,6 +5,12 @@ config TTPCI_EEPROM
 	tristate
 	depends on I2C
 
+# Should match the hybrid card list below
+config MEDIA_HYBRID_USB
+	bool
+	depends on VIDEO_AU0828 || VIDEO_CX231XX || VIDEO_TM6000 || VIDEO_PVRUSB2
+	default y
+
 if USB && MEDIA_SUPPORT
 
 menuconfig MEDIA_USB_SUPPORT
@@ -29,7 +35,6 @@ endif
 
 if MEDIA_ANALOG_TV_SUPPORT
 	comment "Analog TV USB devices"
-source "drivers/media/usb/pvrusb2/Kconfig"
 source "drivers/media/usb/hdpvr/Kconfig"
 source "drivers/media/usb/stk1160/Kconfig"
 source "drivers/media/usb/go7007/Kconfig"
@@ -39,6 +44,7 @@ if (MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT)
 	comment "Analog/digital TV USB devices"
 source "drivers/media/usb/au0828/Kconfig"
 source "drivers/media/usb/cx231xx/Kconfig"
+source "drivers/media/usb/pvrusb2/Kconfig"
 source "drivers/media/usb/tm6000/Kconfig"
 endif
 
drivers/media/usb/au0828/Kconfig +2 -4
index 05cc6c48c26f..2f5ee684a278 100644
@@ -2,12 +2,12 @@
 
 config VIDEO_AU0828
 	tristate "Auvitek AU0828 support"
-	depends on I2C && INPUT && DVB_CORE && USB && VIDEO_V4L2
+	depends on I2C && INPUT && USB
 	select MEDIA_CONTROLLER
 	select MEDIA_CONTROLLER_DVB
 	select I2C_ALGOBIT
 	select VIDEO_TVEEPROM
-	select VIDEOBUF2_VMALLOC if VIDEO_V4L2
+	select VIDEOBUF2_VMALLOC
 	select DVB_AU8522_DTV if MEDIA_SUBDRV_AUTOSELECT
 	select MEDIA_TUNER_XC5000 if MEDIA_SUBDRV_AUTOSELECT
 	select MEDIA_TUNER_MXL5007T if MEDIA_SUBDRV_AUTOSELECT
@@ -22,8 +22,6 @@ config VIDEO_AU0828
 config VIDEO_AU0828_V4L2
 	bool "Auvitek AU0828 v4l2 analog video support"
 	depends on VIDEO_AU0828
-	depends on VIDEO_V4L2=y || VIDEO_V4L2=VIDEO_AU0828
-	select DVB_AU8522_V4L if MEDIA_SUBDRV_AUTOSELECT
 	select VIDEO_TUNER
 	default y
 	help
drivers/media/usb/cx231xx/Kconfig +2 -2
index 2fe2b2d335ba..7e3b189f9dca 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_CX231XX
 	tristate "Conexant cx231xx USB video capture support"
-	depends on VIDEO_DEV && I2C && I2C_MUX
+	depends on I2C && I2C_MUX
 	select VIDEO_TUNER
 	select VIDEO_TVEEPROM
 	select VIDEOBUF2_VMALLOC
@@ -40,7 +40,7 @@ config VIDEO_CX231XX_ALSA
 
 config VIDEO_CX231XX_DVB
 	tristate "DVB/ATSC Support for Cx231xx based TV cards"
-	depends on VIDEO_CX231XX && DVB_CORE
+	depends on VIDEO_CX231XX
 	select MEDIA_TUNER_XC5000 if MEDIA_SUBDRV_AUTOSELECT
 	select MEDIA_TUNER_TDA18271 if MEDIA_SUBDRV_AUTOSELECT
 	select DVB_MB86A20S if MEDIA_SUBDRV_AUTOSELECT
drivers/media/usb/pvrusb2/Kconfig +2 -2
index e6a4f730591b..5bf45f2b2517 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_PVRUSB2
 	tristate "Hauppauge WinTV-PVR USB2 support"
-	depends on VIDEO_V4L2 && I2C
+	depends on I2C
 	select VIDEO_TUNER
 	select VIDEO_TVEEPROM
 	select VIDEO_CX2341X
@@ -36,7 +36,7 @@ config VIDEO_PVRUSB2_SYSFS
 config VIDEO_PVRUSB2_DVB
 	bool "pvrusb2 ATSC/DVB support"
 	default y
-	depends on VIDEO_PVRUSB2 && DVB_CORE
+	depends on VIDEO_PVRUSB2
 	select DVB_LGDT330X if MEDIA_SUBDRV_AUTOSELECT
 	select DVB_S5H1409 if MEDIA_SUBDRV_AUTOSELECT
 	select DVB_S5H1411 if MEDIA_SUBDRV_AUTOSELECT
drivers/media/usb/tm6000/Kconfig +2 -2
index 56e977deba81..ad9cfa855eac 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_TM6000
 	tristate "TV Master TM5600/6000/6010 driver"
-	depends on VIDEO_DEV && I2C && INPUT && RC_CORE && USB
+	depends on I2C && INPUT && RC_CORE && USB
 	select VIDEO_TUNER
 	select MEDIA_TUNER_XC2028
 	select MEDIA_TUNER_XC5000
@@ -28,7 +28,7 @@ config VIDEO_TM6000_ALSA
 
 config VIDEO_TM6000_DVB
 	tristate "DVB Support for tm6000 based TV cards"
-	depends on VIDEO_TM6000 && DVB_CORE && USB
+	depends on VIDEO_TM6000 && USB
 	select DVB_ZL10353
 	help
 	  This adds support for DVB cards based on the tm5600/tm6000 chip.
Signature · 1 line
2.25.1
#37 lore raw

PATCH v4 30/33 media: Kconfig: on !EMBEDDED && !EXPERT, enable driver filtering

In reply to Mauro Carvalho Chehab

Advanced and embedded users know what to do, so, by default, they will likely want to be able to open the entire set of Kconfig media options.

Normal "poor" users usually needs more help when setting stuff, so let's open an more simplified version to them by default.

---
 drivers/media/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/media/Kconfig +1 -0
index db918a89e40e..913903c8e942 100644
@@ -21,6 +21,7 @@ if MEDIA_SUPPORT
 config MEDIA_SUPPORT_FILTER
 	bool "Filter media drivers"
 	depends on MEDIA_SUPPORT
+	default y if !EMBEDDED && !EXPERT
 	help
 	   Configuring the media subsystem can be complex, as there are
 	   hundreds of drivers and other config options.
Signature · 1 line
2.25.1
#13 lore raw

PATCH v4 13/33 media: Kconfig: mark other drivers as test drivers

In reply to Mauro Carvalho Chehab

Neither the PCI skeleton nor the DVB dummy driver are real drivers. They're there just as an example for a driver writter.

Distros should not enable those drivers. So, hide them if MEDIA_TEST_SUPPORT is not selected.

---
 drivers/media/dvb-frontends/Kconfig | 4 ++++
 drivers/media/pci/Kconfig           | 1 +
 2 files changed, 5 insertions(+)
drivers/media/dvb-frontends/Kconfig +4 -0
index a29e9ddf9c82..932fd88fdc12 100644
@@ -944,8 +944,12 @@ config DVB_SP2
 	  CIMaX SP2/SP2HF Common Interface module.
 
 comment "Tools to develop new frontends"
+	depends on MEDIA_TEST_SUPPORT
 
 config DVB_DUMMY_FE
 	tristate "Dummy frontend driver"
 	depends on DVB_CORE
+	depends on MEDIA_TEST_SUPPORT
+	help
+	  Dummy skeleton frontend driver.
 endmenu
drivers/media/pci/Kconfig +1 -0
index 9336f8446cf0..e576283ebbf5 100644
@@ -58,6 +58,7 @@ source "drivers/media/pci/intel/ipu3/Kconfig"
 
 config VIDEO_PCI_SKELETON
 	tristate "Skeleton PCI V4L2 driver"
+	depends on MEDIA_TEST_SUPPORT
 	depends on PCI
 	depends on SAMPLES
 	depends on VIDEO_V4L2 && VIDEOBUF2_CORE
Signature · 1 line
2.25.1
#30 lore raw

PATCH v4 23/33 media: Kconfig: warn if drivers are filtered

In reply to Mauro Carvalho Chehab

As per a tester feedback, add an option to report when the drivers are filtered at the Kconfig menu.

---
 drivers/media/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/media/Kconfig +4 -1
index 8b070fb703f9..79aa83a966db 100644
@@ -28,7 +28,7 @@ menuconfig MEDIA_SUPPORT
 if MEDIA_SUPPORT
 
 config MEDIA_SUPPORT_FILTER
-	bool "Filter devices by their types"
+	bool "Filter media drivers"
 	depends on MEDIA_SUPPORT
 	help
 	   Configuring the media subsystem can be complex, as there are
@@ -203,6 +203,9 @@ source "drivers/media/cec/Kconfig"
 
 comment "Media drivers"
 
+comment "Drivers filtered as selected at 'Filter media drivers'"
+	depends on MEDIA_SUPPORT_FILTER
+
 source "drivers/media/usb/Kconfig"
 source "drivers/media/pci/Kconfig"
 source "drivers/media/radio/Kconfig"
Signature · 1 line
2.25.1
#1 lore raw

PATCH v4 1/33 media: dvb-usb: auto-select CYPRESS_FIRMWARE

In reply to Mauro Carvalho Chehab

At least some of the supported boards by dvb-usb driver need to load the cypress firmware, so select it, as otherwise missing dependencies may popup.

Also, as the cypress firmware load routines are needed only by the dvb-usb, dvb-usb-v2 and go7007 drivers, and those all (now) select it, there's no need to ask the user for manually select it.

---
 drivers/media/common/Kconfig      | 2 +-
 drivers/media/usb/dvb-usb/Kconfig | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/media/common/Kconfig +1 -1
index 1990b7f09454..4ea03b7899a8 100644
@@ -14,7 +14,7 @@ config VIDEO_TVEEPROM
 	depends on I2C
 
 config CYPRESS_FIRMWARE
-	tristate "Cypress firmware helper routines"
+	tristate
 	depends on USB
 
 source "drivers/media/common/videobuf2/Kconfig"
drivers/media/usb/dvb-usb/Kconfig +1 -0
index 1a3e5f965ae4..42334a02cdce 100644
@@ -2,6 +2,7 @@
 config DVB_USB
 	tristate "Support for various USB DVB devices"
 	depends on DVB_CORE && USB && I2C && RC_CORE
+	select CYPRESS_FIRMWARE
 	help
 	  By enabling this you will be able to choose the various supported
 	  USB1.1 and USB2.0 DVB devices.
Signature · 1 line
2.25.1
#2 lore raw

PATCH v4 2/33 media: Kconfig: add an option to filter in/out platform drivers

In reply to Mauro Carvalho Chehab

Most systems don't need support for those, while others only need those, instead of the others.

So, add an option to filter in/out platform drivers.

---
 drivers/media/Kconfig | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/media/Kconfig +16 -5
index 9dfea5c4b6ab..2b6ea8beb919 100644
@@ -87,6 +87,18 @@ config MEDIA_CEC_SUPPORT
 	  Say Y when you have an HDMI receiver, transmitter or a USB CEC
 	  adapter that supports HDMI CEC.
 
+config MEDIA_PLATFORM_SUPPORT
+	bool "Platform-specific devices support"
+	help
+	  Enable support for complex cameras, codecs, and other hardware
+	  that are integrated at the CPU, GPU or on Image Signalling Processor
+	  and don't use PCI, USB or Firewire buses.
+
+	  This is found on Embedded hardware (SoC), on V4L2 codecs and
+	  on some GPU and newer CPU chipsets.
+
+	  Say Y when you want to be able so see such devices.
+
 source "drivers/media/cec/Kconfig"
 
 source "drivers/media/mc/Kconfig"
@@ -161,15 +173,14 @@ source "drivers/media/dvb-core/Kconfig"
 
 comment "Media drivers"
 
-#
-# V4L platform/mem2mem drivers
-#
-
 source "drivers/media/usb/Kconfig"
 source "drivers/media/pci/Kconfig"
+source "drivers/media/radio/Kconfig"
+
+if MEDIA_PLATFORM_SUPPORT
 source "drivers/media/platform/Kconfig"
 source "drivers/media/mmc/Kconfig"
-source "drivers/media/radio/Kconfig"
+endif
 
 comment "Supported FireWire (IEEE 1394) Adapters"
 	depends on DVB_CORE && FIREWIRE
Signature · 1 line
2.25.1
#25 lore raw

PATCH v4 18/33 media: dvb-core: Kconfig: default to use dynamic minors

In reply to Mauro Carvalho Chehab

All modern Linux distributions nowadays use udev or some alternative (like systemd). So, it makes sense to change the default to use dynamic minors.

Please notice that this default doesn't enable any code. It just changes the dvb-core behavior.

---
 drivers/media/dvb-core/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/media/dvb-core/Kconfig +1 -0
index 90e038d5ffd9..61f9e1ce99cb 100644
@@ -19,6 +19,7 @@ config DVB_MAX_ADAPTERS
 config DVB_DYNAMIC_MINORS
 	bool "Dynamic DVB minor allocation"
 	depends on DVB_CORE
+	default y
 	help
 	  If you say Y here, the DVB subsystem will use dynamic minor
 	  allocation for any device that uses the DVB major number.
Signature · 1 line
2.25.1
#7 lore raw

PATCH v4 7/33 media: Kconfig: move comment to siano include

In reply to Mauro Carvalho Chehab

Showing this comment without showing the Siano mmc option is very weird! Place the option together, and make it visible only when showing Siano configuration.

---
 drivers/media/mmc/Kconfig       | 1 -
 drivers/media/mmc/siano/Kconfig | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/media/mmc/Kconfig +0 -1
index de0528c6994a..75aa6de08d53 100644
@@ -1,3 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-only
-comment "Supported MMC/SDIO adapters"
 source "drivers/media/mmc/siano/Kconfig"
drivers/media/mmc/siano/Kconfig +2 -0
index 1919f6fea8b1..570696019a9e 100644
@@ -2,6 +2,8 @@
 #
 # Siano Mobile Silicon Digital TV device configuration
 #
+comment "MMC/SDIO DVB adapters"
+	depends on DVB_CORE && HAS_DMA && MMC
 
 config SMS_SDIO_DRV
 	tristate "Siano SMS1xxx based MDTV via SDIO interface"
Signature · 1 line
2.25.1
#9 lore raw

PATCH v4 9/33 media: Kconfig: mode firewire comment to firewire/Kconfig

In reply to Mauro Carvalho Chehab

This comment should only be visible if the DVB_FIREDTV config will show.

---
 drivers/media/Kconfig          | 2 --
 drivers/media/firewire/Kconfig | 5 ++++-
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/media/Kconfig +0 -2
index f37c0c26fa65..dc0cc42d48ad 100644
@@ -192,8 +192,6 @@ source "drivers/media/test_drivers/Kconfig"
 source "drivers/media/mmc/Kconfig"
 endif
 
-comment "Supported FireWire (IEEE 1394) Adapters"
-	depends on DVB_CORE && FIREWIRE
 source "drivers/media/firewire/Kconfig"
 
 # Common driver options
drivers/media/firewire/Kconfig +4 -1
index e7837da5905b..0c1f326f581f 100644
@@ -1,7 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0-only
+if DVB_CORE && FIREWIRE
+comment "FireWire (IEEE 1394) Adapters"
+
 config DVB_FIREDTV
 	tristate "FireDTV and FloppyDTV"
-	depends on DVB_CORE && FIREWIRE
 	help
 	  Support for DVB receivers from Digital Everywhere
 	  which are connected via IEEE 1394 (FireWire).
@@ -18,3 +20,4 @@ config DVB_FIREDTV_INPUT
 	def_bool INPUT = y || (INPUT = m && DVB_FIREDTV = m)
 
 endif # DVB_FIREDTV
+endif # DVB_CORE && FIREWIRE
Signature · 1 line
2.25.1
#14 lore raw

PATCH v4 14/33 media: Kconfig: simplify some dependencies

In reply to Mauro Carvalho Chehab

both DVB_CORE and VIDEO_DEV already depends on MEDIA_SUPPORT, as they're below an if block.

So, remove this double dependency.

---
 drivers/media/Kconfig | 2 --
 1 file changed, 2 deletions(-)
drivers/media/Kconfig +0 -2
index dc0cc42d48ad..f6763d02f1be 100644
@@ -125,7 +125,6 @@ source "drivers/media/mc/Kconfig"
 
 config VIDEO_DEV
 	tristate
-	depends on MEDIA_SUPPORT
 	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT || MEDIA_PLATFORM_SUPPORT
 
 config VIDEO_V4L2_SUBDEV_API
@@ -146,7 +145,6 @@ source "drivers/media/v4l2-core/Kconfig"
 
 config DVB_CORE
 	tristate
-	depends on MEDIA_SUPPORT
 	depends on MEDIA_DIGITAL_TV_SUPPORT
 	depends on (I2C || I2C=n)
 	default y
Signature · 1 line
2.25.1
#5 lore raw

PATCH v4 5/33 media: Kconfig: update the MEDIA_SUPPORT help message

In reply to Mauro Carvalho Chehab

There are more things than just cameras and TV devices on media. Update the help message accordingly.

---
 drivers/media/Kconfig | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/media/Kconfig +4 -2
index 31fbdb2a8d41..72d4f3e0b081 100644
@@ -18,8 +18,10 @@ menuconfig MEDIA_SUPPORT
 	tristate "Multimedia support"
 	depends on HAS_IOMEM
 	help
-	  If you want to use Webcams, Video grabber devices and/or TV devices
-	  enable this option and other options below.
+	  If you want to use media devices, including Webcams, Video grabber
+	  devices and/or TV devices, V4L2 codecs, etc, enable this option
+	  and other options below.
+
 	  Additional info and docs are available on the web at
 	  <https://linuxtv.org>
 
Signature · 1 line
2.25.1
#3 lore raw

PATCH v4 3/33 media: Kconfig: not all V4L2 platform drivers are for camera

In reply to Mauro Carvalho Chehab

When the platform drivers got added, they were all part of complex camera support. This is not the case anymore, as we now have codecs and other stuff there too.

So, fix the dependencies, in order to not require users to manually select something that it doesn't make sense.

---
 drivers/media/Kconfig          | 3 +--
 drivers/media/platform/Kconfig | 3 ---
 2 files changed, 1 insertion(+), 5 deletions(-)
drivers/media/Kconfig +1 -2
index 2b6ea8beb919..31fbdb2a8d41 100644
@@ -111,8 +111,7 @@ source "drivers/media/mc/Kconfig"
 config VIDEO_DEV
 	tristate
 	depends on MEDIA_SUPPORT
-	depends on MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT
-	default y
+	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT || MEDIA_PLATFORM_SUPPORT
 
 config VIDEO_V4L2_SUBDEV_API
 	bool "V4L2 sub-device userspace API"
drivers/media/platform/Kconfig +0 -3
index e01bbb9dd1c1..c4178420d2c5 100644
@@ -5,7 +5,6 @@
 
 menuconfig V4L_PLATFORM_DRIVERS
 	bool "V4L platform devices"
-	depends on MEDIA_CAMERA_SUPPORT
 	help
 	  Say Y here to enable support for platform-specific V4L drivers.
 
@@ -43,7 +42,6 @@ config VIDEO_ASPEED
 
 config VIDEO_SH_VOU
 	tristate "SuperH VOU video output driver"
-	depends on MEDIA_CAMERA_SUPPORT
 	depends on VIDEO_DEV && I2C
 	depends on ARCH_SHMOBILE || COMPILE_TEST
 	select VIDEOBUF2_DMA_CONTIG
@@ -165,7 +163,6 @@ endif # V4L_PLATFORM_DRIVERS
 menuconfig V4L_MEM2MEM_DRIVERS
 	bool "Memory-to-memory multimedia devices"
 	depends on VIDEO_V4L2
-	depends on MEDIA_CAMERA_SUPPORT
 	help
 	  Say Y here to enable selecting drivers for V4L devices that
 	  use system memory for both source and destination buffers, as opposed
Signature · 1 line
2.25.1
#17 lore raw

PATCH v4 16/33 media: Kconfig: fix selection for test drivers

In reply to Mauro Carvalho Chehab

There are some long-time mistakes related to build test drivers, with regards to depends on/select. Also, as we now want to build any test driver without needing to enable anything else, change the logic in order to properly filter them.

Please notice that the PCI skeleton is somewhat an exception, as it requires to select *both* SAMPLES and MEDIA_TEST_SUPPORT. I almost changed it to be either one, but decided to keep it as-is, as this is something that we don't really need to be included on any distribution.

The only reason for someone to build it is for COMPILE_TEST purposes.

---
 drivers/media/Kconfig               |  2 +-
 drivers/media/dvb-frontends/Kconfig |  9 +++++++--
 drivers/media/pci/Kconfig           | 10 +++++-----
 drivers/media/test_drivers/Kconfig  |  2 +-
 4 files changed, 14 insertions(+), 9 deletions(-)
drivers/media/Kconfig +1 -1
index f400370b2928..9c32616f863a 100644
@@ -119,7 +119,7 @@ comment "Video4Linux core enabled to support hybrid TV devices"
 config VIDEO_DEV
 	tristate
 	prompt "Video4Linux core" if !(MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI)
-	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT || MEDIA_PLATFORM_SUPPORT || MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI
+	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT || MEDIA_PLATFORM_SUPPORT || MEDIA_TEST_SUPPORT || MEDIA_HYBRID_USB || MEDIA_HYBRID_PCI
 
 config VIDEO_V4L2_SUBDEV_API
 	bool "V4L2 sub-device userspace API"
drivers/media/dvb-frontends/Kconfig +7 -2
index 932fd88fdc12..1f45808d94da 100644
@@ -1,3 +1,5 @@
+if MEDIA_DIGITAL_TV_SUPPORT
+
 comment "DVB Frontend drivers hidden by 'Autoselect ancillary drivers'"
 	depends on MEDIA_HIDE_ANCILLARY_SUBDRV
 
@@ -943,13 +945,16 @@ config DVB_SP2
 	help
 	  CIMaX SP2/SP2HF Common Interface module.
 
+endmenu # Customise DVB Frontends
+
+endif # MEDIA_DIGITAL_TV_SUPPORT
+
 comment "Tools to develop new frontends"
 	depends on MEDIA_TEST_SUPPORT
 
 config DVB_DUMMY_FE
 	tristate "Dummy frontend driver"
-	depends on DVB_CORE
 	depends on MEDIA_TEST_SUPPORT
+	select DVB_CORE
 	help
 	  Dummy skeleton frontend driver.
-endmenu
drivers/media/pci/Kconfig +5 -5
index 348da044ec78..44f1efd21272 100644
@@ -6,7 +6,7 @@ config MEDIA_HYBRID_PCI
 	depends on VIDEO_CX18 || VIDEO_CX23885 || VIDEO_CX88 || VIDEO_BT848 || VIDEO_SAA7134 || VIDEO_SAA7164
 	default y
 
-if PCI && MEDIA_SUPPORT
+if PCI
 
 menuconfig MEDIA_PCI_SUPPORT
 	bool "Media PCI Adapters"
@@ -65,11 +65,11 @@ source "drivers/media/pci/intel/ipu3/Kconfig"
 
 config VIDEO_PCI_SKELETON
 	tristate "Skeleton PCI V4L2 driver"
-	depends on MEDIA_TEST_SUPPORT
-	depends on PCI
 	depends on SAMPLES
-	depends on VIDEO_V4L2 && VIDEOBUF2_CORE
-	depends on VIDEOBUF2_MEMOPS && VIDEOBUF2_DMA_CONTIG
+	depends on MEDIA_TEST_SUPPORT
+	depends on PCI && VIDEO_V4L2
+	select VIDEOBUF2_MEMOPS
+	select VIDEOBUF2_DMA_CONTIG
 	help
 	  Enable build of the skeleton PCI driver, used as a reference
 	  when developing new drivers.
drivers/media/test_drivers/Kconfig +1 -1
index 258a4d36c0d3..9f4a9cfbacc9 100644
@@ -4,7 +4,7 @@ if MEDIA_TEST_SUPPORT
 
 menuconfig V4L_TEST_DRIVERS
 	bool "V4L test drivers"
-	depends on MEDIA_CAMERA_SUPPORT
+	depends on VIDEO_DEV
 
 if V4L_TEST_DRIVERS
 
Signature · 1 line
2.25.1
maintainer
#19 lore raw

Re: [PATCH v4 17/33] media: add SPDX headers on Kconfig and Makefile files

In reply to Mauro Carvalho Chehab

Hi Mauro,

Thank you for the patch.

Quoted 2 lines · Mauro Carvalho Chehab

Most of media Kconfig/Makefile files already has SPDX, but there are a few ones still missing. Add it to them.

I think it's a good idea to state the license of each source file, the patch looks fine to me. I've however been thinking about licenses for build system files recently, and I'll hijack this thread a bit to ask a question :-)

For a project like the Linux kernel, and especially for subsystems that are covered by a single license, the choice is easy, we can apply the same license to the build files. However, for a project that contains components covered by different licenses (such as, for instance, an LGPL library, a GPL application and a BSD plugin), how should the license covering the build system files be selected ? I searched a bit for guidance on this topic, and couldn't find much.

Quoted 91 lines
---
 drivers/media/dvb-frontends/Kconfig             | 2 ++
 drivers/media/mc/Kconfig                        | 2 ++
 drivers/media/platform/sunxi/Kconfig            | 2 ++
 drivers/media/platform/sunxi/Makefile           | 2 ++
 drivers/media/platform/sunxi/sun4i-csi/Kconfig  | 2 ++
 drivers/media/platform/sunxi/sun4i-csi/Makefile | 2 ++
 drivers/staging/media/hantro/Makefile           | 2 ++
 drivers/staging/media/rkisp1/Makefile           | 2 ++
 8 files changed, 16 insertions(+)
drivers/media/dvb-frontends/Kconfig +2 -0
index 1f45808d94da..aa24506257b3 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 if MEDIA_DIGITAL_TV_SUPPORT
 
 comment "DVB Frontend drivers hidden by 'Autoselect ancillary drivers'"
drivers/media/mc/Kconfig +2 -0
index 3b9795cfcb36..0c5c52f14c64 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 #
 # Media controller
 #	Selectable only for webcam/grabbers, as other drivers don't use it
drivers/media/platform/sunxi/Kconfig +2 -0
index 71808e93ac2e..7151cc249afa 100644
@@ -1,2 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+
 source "drivers/media/platform/sunxi/sun4i-csi/Kconfig"
 source "drivers/media/platform/sunxi/sun6i-csi/Kconfig"
drivers/media/platform/sunxi/Makefile +2 -0
index ff0993f70dc3..fc537c9f5ca9 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 obj-y		+= sun4i-csi/
 obj-y		+= sun6i-csi/
 obj-y		+= sun8i-di/
drivers/media/platform/sunxi/sun4i-csi/Kconfig +2 -0
index e86e29b6a603..93b4e82a2655 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 config VIDEO_SUN4I_CSI
 	tristate "Allwinner A10 CMOS Sensor Interface Support"
 	depends on VIDEO_V4L2 && COMMON_CLK && VIDEO_V4L2_SUBDEV_API && HAS_DMA
drivers/media/platform/sunxi/sun4i-csi/Makefile +2 -0
index 7c790a57f5ee..5062b006d63e 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 sun4i-csi-y += sun4i_csi.o
 sun4i-csi-y += sun4i_dma.o
 sun4i-csi-y += sun4i_v4l2.o
drivers/staging/media/hantro/Makefile +2 -0
index 68c29a9c4946..743ce08eb184 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 obj-$(CONFIG_VIDEO_HANTRO) += hantro-vpu.o
 
 hantro-vpu-y += \
drivers/staging/media/rkisp1/Makefile +2 -0
index 69ca59c7ef34..ab32a77db8f7 100644
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
 obj-$(CONFIG_VIDEO_ROCKCHIP_ISP1) += rockchip-isp1.o
 rockchip-isp1-objs += 	rkisp1-capture.o \
 			rkisp1-common.o \
Signature · 3 lines
Regards,

Laurent Pinchart
#20 lore raw

Re: [PATCH v4 17/33] media: add SPDX headers on Kconfig and Makefile files

Quoted 13 lines · Laurent Pinchart

Hi Mauro,

Thank you for the patch.

Quoted 2 lines · Mauro Carvalho Chehab

Most of media Kconfig/Makefile files already has SPDX, but there are a few ones still missing. Add it to them.

I think it's a good idea to state the license of each source file, the patch looks fine to me. I've however been thinking about licenses for build system files recently, and I'll hijack this thread a bit to ask a question :-)

Quoted 7 lines

For a project like the Linux kernel, and especially for subsystems that are covered by a single license, the choice is easy, we can apply the same license to the build files. However, for a project that contains components covered by different licenses (such as, for instance, an LGPL library, a GPL application and a BSD plugin), how should the license covering the build system files be selected ? I searched a bit for guidance on this topic, and couldn't find much.

By "default" if there is no license on a file in the kernel tree, it falls under the GPLv2 license and we should explicity state it, like this patch does.

So this is fine, but if you want to license the build files some other way, that's good too, but do so when you add them to the tree, not at some later time when it could cause confusion :)

thanks,

greg k-h

maintainer
#21 lore raw

Re: [PATCH v4 17/33] media: add SPDX headers on Kconfig and Makefile files

Hi Greg,

Quoted 18 lines · Greg Kroah-Hartman
Quoted 9 lines · Laurent Pinchart
Quoted 2 lines · Mauro Carvalho Chehab

Most of media Kconfig/Makefile files already has SPDX, but there are a few ones still missing. Add it to them.

I think it's a good idea to state the license of each source file, the patch looks fine to me. I've however been thinking about licenses for build system files recently, and I'll hijack this thread a bit to ask a question :-)

Quoted 7 lines

For a project like the Linux kernel, and especially for subsystems that are covered by a single license, the choice is easy, we can apply the same license to the build files. However, for a project that contains components covered by different licenses (such as, for instance, an LGPL library, a GPL application and a BSD plugin), how should the license covering the build system files be selected ? I searched a bit for guidance on this topic, and couldn't find much.

Quoted 7 lines

By "default" if there is no license on a file in the kernel tree, it falls under the GPLv2 license and we should explicity state it, like this patch does.

So this is fine, but if you want to license the build files some other way, that's good too, but do so when you add them to the tree, not at some later time when it could cause confusion :)

Thanks for your answer. I was hijacking the thread a little bit, the question wasn't related to the kernel, but in this case to libcamera. We've been wondering how to pick licenses for build files there, and I thought fellow kernel developers may have valuable input on this topic.

Signature · 3 lines
Regards,

Laurent Pinchart
#22 lore raw

Re: [PATCH v4 17/33] media: add SPDX headers on Kconfig and Makefile files

Quoted 25 lines · Laurent Pinchart

Hi Greg,

Quoted 22 lines · Greg Kroah-Hartman
Quoted 9 lines · Laurent Pinchart
Quoted 2 lines · Mauro Carvalho Chehab

Most of media Kconfig/Makefile files already has SPDX, but there are a few ones still missing. Add it to them.

I think it's a good idea to state the license of each source file, the patch looks fine to me. I've however been thinking about licenses for build system files recently, and I'll hijack this thread a bit to ask a question :-)

Quoted 7 lines

For a project like the Linux kernel, and especially for subsystems that are covered by a single license, the choice is easy, we can apply the same license to the build files. However, for a project that contains components covered by different licenses (such as, for instance, an LGPL library, a GPL application and a BSD plugin), how should the license covering the build system files be selected ? I searched a bit for guidance on this topic, and couldn't find much.

By "default" if there is no license on a file in the kernel tree, it falls under the GPLv2 license and we should explicity state it, like this patch does.

Quoted 8 lines
Quoted 3 lines

So this is fine, but if you want to license the build files some other way, that's good too, but do so when you add them to the tree, not at some later time when it could cause confusion :)

Thanks for your answer. I was hijacking the thread a little bit, the question wasn't related to the kernel, but in this case to libcamera. We've been wondering how to pick licenses for build files there, and I thought fellow kernel developers may have valuable input on this topic.

I would make the files the same license as your project overall is to make things simpler for everyone involved :)

thanks,

greg k-h

maintainer
#23 lore raw

Re: [PATCH v4 17/33] media: add SPDX headers on Kconfig and Makefile files

Hi Greg,

Quoted 28 lines · Greg Kroah-Hartman
Quoted 27 lines · Laurent Pinchart
Quoted 25 lines · Greg Kroah-Hartman
Quoted 9 lines · Laurent Pinchart
Quoted 2 lines · Mauro Carvalho Chehab

Most of media Kconfig/Makefile files already has SPDX, but there are a few ones still missing. Add it to them.

I think it's a good idea to state the license of each source file, the patch looks fine to me. I've however been thinking about licenses for build system files recently, and I'll hijack this thread a bit to ask a question :-)

Quoted 7 lines

For a project like the Linux kernel, and especially for subsystems that are covered by a single license, the choice is easy, we can apply the same license to the build files. However, for a project that contains components covered by different licenses (such as, for instance, an LGPL library, a GPL application and a BSD plugin), how should the license covering the build system files be selected ? I searched a bit for guidance on this topic, and couldn't find much.

By "default" if there is no license on a file in the kernel tree, it falls under the GPLv2 license and we should explicity state it, like this patch does.

So this is fine, but if you want to license the build files some other way, that's good too, but do so when you add them to the tree, not at some later time when it could cause confusion :)

Quoted 7 lines
Quoted 4 lines

Thanks for your answer. I was hijacking the thread a little bit, the question wasn't related to the kernel, but in this case to libcamera. We've been wondering how to pick licenses for build files there, and I thought fellow kernel developers may have valuable input on this topic.

I would make the files the same license as your project overall is to make things simpler for everyone involved :)

I would if the project had a single license, but we have GPL, LGPL and BSD components :-S

Signature · 3 lines
Regards,

Laurent Pinchart
#24 lore raw

SPDX headers - Was: Re: [PATCH v4 17/33] media: add SPDX headers on Kconfig and Makefile files

In reply to Laurent Pinchart

Em Tue, 31 Mar 2020 15:06:08 +0300
Laurent Pinchart <[email protected]> escreveu:

Quoted 3 lines

I've however been thinking about licenses for
build system files recently, and I'll hijack this thread a bit to ask a question :-)

Ok, I'll change the subject, as the answers won't be related to the Kernel :-)

Quoted 7 lines

For a project like the Linux kernel, and especially for subsystems that are covered by a single license, the choice is easy, we can apply the same license to the build files. However, for a project that contains components covered by different licenses (such as, for instance, an LGPL library, a GPL application and a BSD plugin), how should the license covering the build system files be selected ? I searched a bit for guidance on this topic, and couldn't find much.

Then everything becomes a way more complex :-)

I guess nobody has a clear answer for that. Also, IANAL.

What I can tell is what it would makes sense for me.

The big impact of a complex licenses model would be for the ones packaging it on some distro, and for the users of such distros.

The distros need to know if they have the rights to redistribute, and need to notify their usages about each package's license.

Let's assume a project "foo-utils" that has such complexity.

Assuming a project that started on a green field (like libcamera), and such project doesn't use stuff from external libraries, what one could do would be to design it in a way that different licenses would be packaged differently. For instance:

foo-libs # everything here is under LGPL
foo-bsd-plugin # everything here is under BSD
foo-utils # everything here is under GPLv3

Then, on each of them, a COPYING.foo file (or whatever other way distros would use to identify the per-package license) would contain the license with applied to it.

Btw, if you want to take a look on a real-case scenario, see, for example:

	https://build.opensuse.org/package/view_file/devel:libraries:c_c++/v4l-utils/v4l-utils.spec?rev=a250bff0f849e8c2fa7e476a1f2849a8

	%package -n libv4l-devel
	License:        LGPLv2+
	
	...

	%package -n     qv4l2
	License:        GPLv2+

Btw, GStreamer actually follows a similar approach, but they even split those into different git trees (core, good, bad and ugly plugins).

Thanks,
Mauro

#16 lore raw

Re: [PATCH v4 15/33] media: Kconfig: better support hybrid TV devices

In reply to Mauro Carvalho Chehab
I love your patch! Yet something to improve:

Hi Mauro,

I love your patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on sunxi/sunxi/for-next linus/master v5.6 next-20200331] [cannot apply to linux/master]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/Media-Kconfig-menu-reorg-and-improvements/20200401-014843
base:   git://linuxtv.org/media_tree.git master
config: x86_64-randconfig-d002-20200331 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-6) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

ld: drivers/media/dvb-core/dvbdev.o: in function `dvb_module_probe':

>> drivers/media/dvb-core/dvbdev.c:986: undefined reference to `i2c_new_client_device'
>> ld: drivers/media/dvb-core/dvbdev.c:993: undefined reference to `i2c_unregister_device'
   ld: drivers/media/dvb-core/dvbdev.o: in function `dvb_module_release':
>> drivers/media/dvb-core/dvbdev.c:1008: undefined reference to `i2c_unregister_device'

vim +986 drivers/media/dvb-core/dvbdev.c

^1da177e4c3f41 drivers/media/dvb/dvb-core/dvbdev.c Linus Torvalds        2005-04-16   963  
1980bfa67f19d6 drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-07   964  #if IS_ENABLED(CONFIG_I2C)
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   965  struct i2c_client *dvb_module_probe(const char *module_name,
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   966  				    const char *name,
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   967  				    struct i2c_adapter *adap,
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   968  				    unsigned char addr,
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   969  				    void *platform_data)
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   970  {
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   971  	struct i2c_client *client;
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   972  	struct i2c_board_info *board_info;
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   973  
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   974  	board_info = kzalloc(sizeof(*board_info), GFP_KERNEL);
39adb4e739050d drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-22   975  	if (!board_info)
39adb4e739050d drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-22   976  		return NULL;
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   977  
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   978  	if (name)
c0decac19da390 drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-09-10   979  		strscpy(board_info->type, name, I2C_NAME_SIZE);
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   980  	else
c0decac19da390 drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-09-10   981  		strscpy(board_info->type, module_name, I2C_NAME_SIZE);
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   982  
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   983  	board_info->addr = addr;
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   984  	board_info->platform_data = platform_data;
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   985  	request_module(module_name);
d928440cf4603b drivers/media/dvb-core/dvbdev.c     Wolfram Sang          2019-12-16  @986  	client = i2c_new_client_device(adap, board_info);
d928440cf4603b drivers/media/dvb-core/dvbdev.c     Wolfram Sang          2019-12-16   987  	if (!i2c_client_has_driver(client)) {
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   988  		kfree(board_info);
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   989  		return NULL;
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   990  	}
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   991  
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   992  	if (!try_module_get(client->dev.driver->owner)) {
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  @993  		i2c_unregister_device(client);
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   994  		client = NULL;
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   995  	}
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   996  
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   997  	kfree(board_info);
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   998  	return client;
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02   999  }
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  1000  EXPORT_SYMBOL_GPL(dvb_module_probe);
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  1001  
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  1002  void dvb_module_release(struct i2c_client *client)
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  1003  {
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  1004  	if (!client)
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  1005  		return;
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  1006  
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  1007  	module_put(client->dev.driver->owner);
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02 @1008  	i2c_unregister_device(client);
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  1009  }
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  1010  EXPORT_SYMBOL_GPL(dvb_module_release);
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  1011  #endif
8f569c0b4e6b6b drivers/media/dvb-core/dvbdev.c     Mauro Carvalho Chehab 2018-03-02  1012  

:::::: The code at line 986 was first introduced by commit
:::::: d928440cf4603b4889af3e6785d9200a626ae0ce media: dvb-core: dvbdev: convert to use i2c_new_client_device()

:::::: TO: Wolfram Sang <[email protected]> :::::: CC: Mauro Carvalho Chehab <[email protected]>

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