Skip to contentSkip to conversation

media: i2c: cvs: Do not hide the option in the ancillary menu

PATCH In review Junjie Cao 3 participants 4 messages Sep 13 – Sep 18

Subsystems (6)
lore
Share & tools
lore

Junjie Cao

author
#0 lore raw

PATCH 1/1 media: i2c: cvs: Do not hide the option in the ancillary menu

A camera behind a CVS device needs intel_cvs bound: since commit c28527ce5d06 ("ACPI: scan: Honor _DEP for Intel CVS devices") the sensor is not enumerated until the driver's probe clears the _DEP, and since commit c6b1b34b5090 ("media: pci: intel: Add CVS support for IPU bridge driver") the IPU notifier waits for the "Intel CVS" sub-device. The option is sourced from the "Miscellaneous helper chips" menu, which MEDIA_HIDE_ANCILLARY_SUBDRV hides on any config with MEDIA_SUBDRV_AUTOSELECT=y and neither EXPERT nor COMPILE_TEST, and nothing selects or implies it, so olddefconfig on such a config does not write the symbol out at all.

Arch Linux's config.x86_64 for 7.2.4 is one: I2C, ACPI, VIDEO_DEV=m, IPU_BRIDGE=m, INTEL_VSC=m, VIDEO_INTEL_IPU6=m, VIDEO_INTEL_IPU7=m and no VIDEO_INTEL_CVS line. On such a kernel a Panther Lake laptop has either no CVS driver, so the sensor is never enumerated, or the out-of-tree intel_cvs from intel/vision-drivers, which registers no sub-device; the second Link shows the IPU notifier pending on INTC10E1-0/port@1/endpoint@0 on such a kernel. Both reports had a working camera on 7.1.

Source the Kconfig from drivers/media/pci/intel/ next to INTEL_VSC and imply it from the IPU6 and IPU7 drivers, which are the IPUs the driver looks for, so that a config that has them picks up intel_cvs=m on the next olddefconfig.

Fixes 8e2b43d2c10b ("media: i2c: cvs: Add driver of Intel Computer Vision Sensing Controller(CVS)")

---
Tested by running olddefconfig with Arch's config.x86_64 (7.2.4.arch1) on current mainline: before, no VIDEO_INTEL_CVS line; after, CONFIG_VIDEO_INTEL_CVS=m. With EXPERT=y alone the option only becomes "is not set". Not booted on CVS hardware.

For stable: a 7.2.y distro config with IPU6/IPU7 gains intel_cvs=m on its next olddefconfig; that is the intent. Sourcing from pci/intel/ puts the option under MEDIA_PCI_SUPPORT like IPU_BRIDGE and INTEL_VSC, which a CVS system needs anyway.

 drivers/media/i2c/Kconfig            | 1 -
 drivers/media/pci/intel/Kconfig      | 1 +
 drivers/media/pci/intel/ipu6/Kconfig | 1 +
 drivers/staging/media/ipu7/Kconfig   | 1 +
 4 files changed, 3 insertions(+), 1 deletion(-)
drivers/media/i2c/Kconfig +0 -1
index 5c52007f9cbeb..8573f27b907d9 100644
@@ -1680,7 +1680,6 @@ endmenu
 menu "Miscellaneous helper chips"
 	visible if !MEDIA_HIDE_ANCILLARY_SUBDRV
 
-source "drivers/media/i2c/cvs/Kconfig"
 
 config VIDEO_I2C
 	tristate "I2C transport video support"
drivers/media/pci/intel/Kconfig +1 -0
index 3f14ca110d06c..dd8c990a0c294 100644
@@ -3,6 +3,7 @@
 source "drivers/media/pci/intel/ipu3/Kconfig"
 source "drivers/media/pci/intel/ipu6/Kconfig"
 source "drivers/media/pci/intel/ivsc/Kconfig"
+source "drivers/media/i2c/cvs/Kconfig"
 
 config IPU_BRIDGE
 	tristate "Intel IPU Bridge"
drivers/media/pci/intel/ipu6/Kconfig +1 -0
index 1129e2beb4bec..54bd264f7ccd4 100644
@@ -10,6 +10,7 @@ config VIDEO_INTEL_IPU6
 	select MEDIA_CONTROLLER
 	select VIDEOBUF2_DMA_SG
 	select V4L2_FWNODE
+	imply VIDEO_INTEL_CVS
 	help
 	  This is the 6th Gen Intel Image Processing Unit, found in Intel SoCs
 	  and used for capturing images and video from camera sensors.
drivers/staging/media/ipu7/Kconfig +1 -0
index 7d831ba7501d4..c23a7844e15e2 100644
@@ -11,6 +11,7 @@ config VIDEO_INTEL_IPU7
 	select MEDIA_CONTROLLER
 	select VIDEOBUF2_DMA_SG
 	select V4L2_FWNODE
+	imply VIDEO_INTEL_CVS
 	help
 	  This is the 7th Gen Intel Image Processing Unit, found in Intel SoCs
 	  and used for capturing images and video from camera sensors.
Signature · 1 line
2.43.0
Tested-by on v1 1/1
#1 lore raw

Confirmed on linux-ptl, as you asked. Config-only test, same scope as yours - not booted with a kernel built this way.

Starting config: linux-ptl 7.2.3-arch1-1, the Panther Lake kernel Omarchy ships, taken from /lib/modules/.../build/.config. It has CONFIG_MEDIA_HIDE_ANCILLARY_SUBDRV=y, no CONFIG_EXPERT, and no VIDEO_INTEL_CVS line at all.

Run on a vanilla v7.2.4 tree. linux-ptl does not touch the files involved:
drivers/media/{i2c,pci/intel,pci/intel/ipu6}/Kconfig, drivers/staging/media/ipu7/Kconfig and drivers/media/i2c/cvs/Kconfig are byte-identical to vanilla, as is every other Kconfig under drivers/media.

before: make olddefconfig -> no VIDEO_INTEL_CVS line
after: make olddefconfig -> CONFIG_VIDEO_INTEL_CVS=m

Diffing the two generated configs shows exactly one changed line, the added CONFIG_VIDEO_INTEL_CVS=m. Nothing else moves.

Worth noting for the stable case you mention: this is a distro kernel that already carries IPU_BRIDGE=m and VIDEO_INTEL_IPU7=m, so it is precisely the configuration whose bridge routes to a driver it cannot currently build.

Assisted-by Claude Code:claude-opus-5
maintainer
#2 lore raw
In reply to Junjie Cao

Hi Junjie,

Thanks for the patch.

Quoted 25 lines · Junjie Cao

A camera behind a CVS device needs intel_cvs bound: since commit c28527ce5d06 ("ACPI: scan: Honor _DEP for Intel CVS devices") the sensor is not enumerated until the driver's probe clears the _DEP, and since commit c6b1b34b5090 ("media: pci: intel: Add CVS support for IPU bridge driver") the IPU notifier waits for the "Intel CVS" sub-device. The option is sourced from the "Miscellaneous helper chips" menu, which MEDIA_HIDE_ANCILLARY_SUBDRV hides on any config with MEDIA_SUBDRV_AUTOSELECT=y and neither EXPERT nor COMPILE_TEST, and nothing selects or implies it, so olddefconfig on such a config does not write the symbol out at all.

Arch Linux's config.x86_64 for 7.2.4 is one: I2C, ACPI, VIDEO_DEV=m, IPU_BRIDGE=m, INTEL_VSC=m, VIDEO_INTEL_IPU6=m, VIDEO_INTEL_IPU7=m and no VIDEO_INTEL_CVS line. On such a kernel a Panther Lake laptop has either no CVS driver, so the sensor is never enumerated, or the out-of-tree intel_cvs from intel/vision-drivers, which registers no sub-device; the second Link shows the IPU notifier pending on INTC10E1-0/port@1/endpoint@0 on such a kernel. Both reports had a working camera on 7.1.

Source the Kconfig from drivers/media/pci/intel/ next to INTEL_VSC and imply it from the IPU6 and IPU7 drivers, which are the IPUs the driver looks for, so that a config that has them picks up intel_cvs=m on the next olddefconfig.

Quoted 5 lines
Fixes 8e2b43d2c10b ("media: i2c: cvs: Add driver of Intel Computer Vision Sensing Controller(CVS)")

I agree there's a problem here with Kconfig but I don't think this is a proper fix for it: CVS is clearly an I²C device and unrelated to IPU6 as such. (Well, you could claim this about IVSC, too, but we don't have MEI directory under media tree.)

I any case I think the MEDIA_HIDE_ANCILLARY_SUBDRV option should go; it hides configuration options that should be selected for most distribution kernels while "autoselecting" the necessary drivers appears to be helpful while actually just selecting those that are mounted on actual devices, e.g. PCI cards.

I'll post a patch for this.

Signature · 3 lines
Kind regards,

Sakari Ailus
author
#3 lore raw
Quoted 1 line · Sakari Ailus

I'll post a patch for this.

Sounds good, I'll drop this one. Thanks.