media: i2c: cvs: Add Intel CVS driver
Subsystems (3)
Miguel Vadillo
maintainerv5 cover media: i2c: cvs: Add Intel CVS driver
Cover Letter
------------
This patch series introduces support for Intel Computer Vision Sensing (CVS) devices found on Intel Luna Lake (LNL), Panther Lake (PTL), and Arrow Lake (ARL) platforms.
OVERVIEW
--------
The CVS device acts as a V4L2 sub-device bridge that manages CSI-2 link ownership between the host (Linux) and firmware for camera sensors. It provides:
1. CSI-2 link ownership arbitration between host and CVS firmware
2. MIPI CSI-2 configuration management
3. Privacy LED control coordination
4. Power management integration with runtime PM
The driver consists of two main components:
- core.c: Core driver with probe, command transport, and PM callbacks
- v4l2.c: V4L2 sub-device and media framework integration
HARDWARE DETAILS
----------------
CVS devices interface via:
- I2C for command/control communication with the device firmware
- GPIO signals for ownership handshaking (request/response)
- Optional reset and wake interrupt for full-capability variants
- Integration with Intel IPU (Image Processing Unit) via ipu_bridge
The driver supports two hardware capability levels:
- Light capability: Basic GPIO-based ownership (2 GPIOs)
- Full capability: Enhanced with reset control and wake IRQ (4 GPIOs)
In order to support both configurations and all devices on the field, the driver detects the number of GPIOs and uses add_driver_gpios respectively.
DEVICE QUIRKS
-------------
The driver includes a quirk table to handle device-specific variations across different CVS implementations (e.g., Lattice, Synaptics vendors) that may differ in:
- MIPI configuration requirements
- Buffer and header sizes
- Reset sequence requirements
FIRMWARE PROTOCOL
-----------------
The CVS firmware supports a command-response protocol over I2C with:
- Device state queries (GET_DEV_STATE, GET_DEV_CAPABILITY)
- Host identification (SET_DEV_HOST_ID)
- MIPI configuration (HOST_SET_MIPI_CONFIG, HOST_GET_MIPI_CONFIG)
- CSI ownership control (HOST_SENSOR_OWNER)
The protocol supports versioning (currently 2.2+) and optional response prefixes for backward compatibility.
V4L2 INTEGRATION
----------------
The CVS driver registers as a V4L2 sub-device exposing:
- Sink pad: Receives frames from remote camera sensor
- Source pad: Emits frames to downstream IPU/consumers
- Async notifier: Discovers and connects to upstream sensors via ACPI
It implements standard V4L2 operations:
- enable/disable_stream: Start/stop streaming with ownership handoff
- set_fmt/get_fmt: Format negotiation with format mirroring
- get_mbus_config: CSI-2 bus configuration queries
PLATFORM SUPPORT
----------------
In addition to I2C-based operation, the driver supports platform device instantiation for systems where CVS is exposed without I2C transport, falling back to GPIO-only ownership control.
BIOS is presenting the device wrongly in some cases. These devices are already on the field thus need to support as is.
POWER MANAGEMENT
----------------
Runtime PM integration allows the device to:
- Auto-suspend after 1 second of inactivity
- Resume on streaming start
- Coordinate with IPU power states
A PM runtime device link (DL_FLAG_PM_RUNTIME) is registered between IPU (consumer) and CVS (supplier) so that the PM framework automatically resumes CVS before IPU begins capture. CSI-2 link ownership is claimed in cvs_runtime_resume() and released in cvs_runtime_suspend(), decoupling ownership management from the V4L2 streaming path.
DEPENDENCIES
------------
- Intel IPU bridge (ipu-bridge.ko) for ACPI sensor discovery
SYSTEM DIAGRAM
--------------
Below diagram shows connections of CVS/ISH/IPU and Camera Sensor:
-----------------------------------------------------------------------
| Host Processor |
| |
| --------------- --------------- --------------- |
| | | | | | | |
| | IPU | | ISH | |camera driver|----| |
| | | | | | | | |
| --------------- --------------- --------------- | |
| | | | | |
| | | | | |
| | | --------------- | |
| | | | | | |
| | | | CVS driver | | |
| | | | | | |
| | | --------------- | |
| | | | | |
---------|-----------------|-----------------|------------|------------
| CSI | I2C | I2C |
| | | |
---------|-----------------|-----------------|---------- |
| CVS | | | |
| | | | | I2C
| ----------------------------- | | |
| | |-------------| | |
| | CVS FW | | |
| | | | |
| ----------------------------- | |
| | CSI | |
---------|--------------------------------------------- |
| CSI |
| |
-------------------------------- |
| | I2C |
| Camera Sensor |---------------------|
| |
--------------------------------USAGE EXAMPLE
-------------
# Load driver
modprobe intel_cvs
# Configure media pipeline (example with IPU7 + ov08x40)
media-ctl -v -V \
"\"Intel CVS\":1 [fmt:SGRBG10/3856x2176]"
media-ctl -v -V \
"\"Intel IPU7 CSI2 0\":0 [fmt:SGRBG10/3856x2176]"
media-ctl -v -V \
"\"Intel IPU7 CSI2 0\":1 [fmt:SGRBG10/3856x2176]"
media-ctl -v -l \
"\"Intel CVS\":1 -> \"Intel IPU7 CSI2 0\":0[1]"
media-ctl -v -l \
"\"Intel IPU7 CSI2 0\":1 -> \"Intel IPU7 ISYS Capture 0\":0[1]"
media-ctl -v -V \
"\"ov08x40 8-0010\":0 [fmt:SGRBG10/3856x2176]"
yavta -c1 -n1 -s 3856x2176 \
--file=/tmp/frame-CSI1.bin -f SGRBG10 /dev/video0Changes in v5:
- Add __maybe_unused to the four PM callbacks to silence
-Wunused-function when CONFIG_PM is disabled.
- Use pm_ptr(&cvs_pm_ops) in both i2c_driver and platform_driver
structs so the ops pointer is NULL when CONFIG_PM is disabled.
- Link to v4: https://lore.kernel.org/linux-media/[email protected]/
Changes in v4:
- Use __free(kfree) cleanup attribute for buf in cvs_read_i2c(),
removing the two manual kfree() calls on the error and success
return paths.
- Add lockdep_assert_held(&ctx->lock) at the start of cvs_send() to
document and enforce the locking precondition.
- Fix ordering in cvs_core_remove(): call cancel_delayed_work_sync()
before cvs_csi_remove() so the delayed work cannot fire and access
CSI resources after they have been torn down.
- Consolidate put_device(&ipu->dev) error path and return error once.
- Link to v3: https://lore.kernel.org/linux-media/[email protected]/
Changes in v3:
- Replace icvs_pci_tbl (which duplicated the IPU6 entries already in
ipu6_pci_tbl from ipu6-pci-table.h) with icvs_ipu7_tbl containing
only the two IPU7 IDs. Probe now iterates ipu6_pci_tbl first, then
icvs_ipu7_tbl, eliminating the sparse unused-variable warning.
- Use cvs_read_i2c() for the prefix probe in cvs_hw_init() instead of
open-coded i2c_master_send/recv; drop the redundant n.cmd_id
assignment by reusing the cmd variable for both reads.
- Add patch 3: ACPI scan fix to honor _DEP for Intel CVS devices so
that the ACPI scan waits for CVS dependencies before marking the
device ready.
- Link to v2: https://lore.kernel.org/linux-media/[email protected]/
Changes in v2:
- Add MAINTAINERS entry for the CVS driver.
- Initialize status in cvs_send() to fix maybe-uninitialized warning.
- Convert command ID fields to __be16 and use be16/cpu helpers to fix
sparse type warnings.
- Move icvs_pci_tbl out of icvs.h and into core.c to avoid unused
static table warnings in other translation units.
- Update kernel-doc for cvs_send() to document @cmd correctly.
- Fix non-kernel-doc comment delimiter in icvs.h.
- Wrap long comment lines in core.c to keep within 80 columns.
- Move Kconfig entry to "Miscellaneous helper chips" section.
- Update Kconfig help text to focus on CVS function without mentioning
firmware download or quirks.
- Use ipu6-pci-table.h for IPU6 PCI device ID definitions instead of
redefining them locally.
- Link to v1: https://lore.kernel.org/linux-media/[email protected]/
Miguel Vadillo (3):
media: i2c: cvs: Add driver of Intel Computer Vision Sensing
Controller(CVS)
media: pci: intel: Add CVS support for IPU bridge driver
ACPI: scan: Honor _DEP for Intel CVS devices
MAINTAINERS | 6 + drivers/acpi/scan.c | 5 +- drivers/media/i2c/Kconfig | 2 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/cvs/Kconfig | 21 + drivers/media/i2c/cvs/Makefile | 4 + drivers/media/i2c/cvs/core.c | 1043 ++++++++++++++++++++++++++ drivers/media/i2c/cvs/icvs.h | 495 ++++++++++++ drivers/media/i2c/cvs/v4l2.c | 618 +++++++++++++++ drivers/media/pci/intel/ipu-bridge.c | 13 +- 10 files changed, 2204 insertions(+), 4 deletions(-) create mode 100644 drivers/media/i2c/cvs/Kconfig create mode 100644 drivers/media/i2c/cvs/Makefile create mode 100644 drivers/media/i2c/cvs/core.c create mode 100644 drivers/media/i2c/cvs/icvs.h create mode 100644 drivers/media/i2c/cvs/v4l2.c
Signature · 1 line
2.43.0
Miguel Vadillo
maintainerPATCH v5 1/3 media: i2c: cvs: Add driver of Intel Computer Vision Sensing Controller(CVS)
Add driver for Intel Computer Vision Sensing (CVS) devices found on Intel Luna Lake (LNL), Panther Lake (PTL), and Arrow Lake (ARL) platforms.
The CVS device acts as a V4L2 sub-device bridge that manages CSI-2 link ownership between the host (Linux) and firmware for camera sensors. It provides:
- Query the device status via sysfs interface
- CSI-2 link ownership arbitration between host and CVS firmware
- MIPI CSI-2 configuration management
- Privacy LED control coordination
- Power management integration with runtime PM
The driver consists of two main components:
core.c: Core driver with probe, command transport, and power management v4l2.c: V4L2 sub-device and media framework integration
Hardware Interface:
- I2C for command/control communication with device firmware
- GPIO signals for ownership handshaking (request/response)
- Optional reset and wake interrupt for full-capability variants
- Integration with Intel IPU via ipu_bridge
The driver supports two hardware capability levels:
- Light capability: Basic GPIO-based ownership (2 GPIOs)
- Full capability: Enhanced with reset control and wake IRQ (4 GPIOs)
Device-specific quirks are handled via a quirk table to accommodate variations across different CVS implementations (Lattice, Synaptics).
In addition to I2C-based operation, the driver supports platform device instantiation for systems where CVS is exposed without I2C transport, falling back to GPIO-only ownership control.
The CVS driver integrates with the IPU bridge for automatic device discovery via ACPI on supported platforms.
PCI device IDs for Intel IPU7 (0x645d, shared by MTL and LNL) and IPU7.5 (0xb05d, shared by ARL and PTL) are included in the driver-local icvs_pci_tbl lookup table, enabling CVS to locate these IPU variants without modifying the shared ipu6-pci-table header.
A PM runtime device link is established between IPU (consumer) and CVS (supplier) so that the PM framework automatically resumes CVS before IPU begins streaming, triggering cvs_runtime_resume() to claim CSI-2 link ownership. Ownership is released via cvs_runtime_suspend() after the autosuspend delay.
--- MAINTAINERS | 6 + drivers/media/i2c/Kconfig | 2 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/cvs/Kconfig | 21 + drivers/media/i2c/cvs/Makefile | 4 + drivers/media/i2c/cvs/core.c | 1043 ++++++++++++++++++++++++++++++++ drivers/media/i2c/cvs/icvs.h | 495 +++++++++++++++ drivers/media/i2c/cvs/v4l2.c | 618 +++++++++++++++++++ 8 files changed, 2190 insertions(+) create mode 100644 drivers/media/i2c/cvs/Kconfig create mode 100644 drivers/media/i2c/cvs/Makefile create mode 100644 drivers/media/i2c/cvs/core.c create mode 100644 drivers/media/i2c/cvs/icvs.h create mode 100644 drivers/media/i2c/cvs/v4l2.c
MAINTAINERS +6 -0
@@ -12750,6 +12750,12 @@ S: Orphan T: git git://git.code.sf.net/p/intel-sas/isci F: drivers/scsi/isci/ +INTEL COMPUTER VISION SENSING (CVS) DRIVER +M: Miguel Vadillo <[email protected]> +L: [email protected] +S: Maintained +F: drivers/media/i2c/cvs/ + INTEL CPU family model numbers M: Tony Luck <[email protected]> M: [email protected]
drivers/media/i2c/Kconfig +2 -0
@@ -1632,6 +1632,8 @@ 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" depends on VIDEO_DEV && I2C
drivers/media/i2c/Makefile +1 -0
@@ -169,3 +169,4 @@ obj-$(CONFIG_VIDEO_VP27SMPX) += vp27smpx.o obj-$(CONFIG_VIDEO_VPX3220) += vpx3220.o obj-$(CONFIG_VIDEO_WM8739) += wm8739.o obj-$(CONFIG_VIDEO_WM8775) += wm8775.o +obj-$(CONFIG_VIDEO_INTEL_CVS) += cvs/
drivers/media/i2c/cvs/Kconfig new file +21 -0
@@ -0,0 +1,21 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config VIDEO_INTEL_CVS + tristate "Intel CVS CSI-2 bridge support" + depends on I2C && ACPI && VIDEO_DEV + depends on IPU_BRIDGE || !IPU_BRIDGE + select MEDIA_CONTROLLER + select VIDEO_V4L2_SUBDEV_API + select V4L2_FWNODE + help + This adds support for the Intel Computer Vision Sensing (CVS). + + The driver registers a V4L2 sub-device to arbitrate CSI-2 link + ownership between the host and CVS firmware, and configures the + device for camera sensor streaming. + + The driver can operate with full I2C transport or in a reduced + platform (GPIO-only) mode when I2C is unavailable. + + Say Y to build into the kernel, or M to build as a module. + The module will be named intel_cvs. If unsure, say N.
drivers/media/i2c/cvs/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-only +intel_cvs-y := core.o v4l2.o + +obj-$(CONFIG_VIDEO_INTEL_CVS) += intel_cvs.o
drivers/media/i2c/cvs/core.c new file +1043 -0
1,043 lines not on this page · raw message
drivers/media/i2c/cvs/icvs.h new file +495 -0
495 lines not on this page · raw message
drivers/media/i2c/cvs/v4l2.c new file +618 -0
618 lines not on this page · raw message
Signature · 1 line
2.43.0
Re: [PATCH v5 1/3] media: i2c: cvs: Add driver of Intel Computer Vision Sensing Controller(CVS)
Hi Miguel,
thank you for the patch
Quoted 43 lines · Miguel Vadillo
Add driver for Intel Computer Vision Sensing (CVS) devices found on Intel Luna Lake (LNL), Panther Lake (PTL), and Arrow Lake (ARL) platforms.
The CVS device acts as a V4L2 sub-device bridge that manages CSI-2 link ownership between the host (Linux) and firmware for camera sensors. It provides:
- Query the device status via sysfs interface
- CSI-2 link ownership arbitration between host and CVS firmware
- MIPI CSI-2 configuration management
- Privacy LED control coordination
- Power management integration with runtime PMThe driver consists of two main components:
core.c: Core driver with probe, command transport, and power managementv4l2.c: V4L2 sub-device and media framework integrationHardware Interface:
- I2C for command/control communication with device firmware
- GPIO signals for ownership handshaking (request/response)
- Optional reset and wake interrupt for full-capability variants
- Integration with Intel IPU viaipu_bridgeThe driver supports two hardware capability levels:
- Light capability: Basic GPIO-based ownership (2 GPIOs)
- Full capability: Enhanced with reset control and wake IRQ (4 GPIOs)Device-specific quirks are handled via a quirk table to accommodate variations across different CVS implementations (Lattice, Synaptics).
In addition to I2C-based operation, the driver supports platform device instantiation for systems where CVS is exposed without I2C transport, falling back to GPIO-only ownership control.
The CVS driver integrates with the IPU bridge for automatic device discovery via ACPI on supported platforms.
PCI device IDs for Intel IPU7 (
0x645d, shared by MTL and LNL) and IPU7.5 (0xb05d, shared by ARL and PTL) are included in the driver-localicvs_pci_tbllookup table, enabling CVS to locate these IPU variants without modifying the shared ipu6-pci-table header.
Quoted 7 lines
A PM runtime device link is established between IPU (consumer) and CVS (supplier) so that the PM framework automatically resumes CVS before IPU begins streaming, triggering
cvs_runtime_resume()to claim CSI-2 link ownership. Ownership is released viacvs_runtime_suspend()after the autosuspend delay.Signed-off-by Miguel Vadillo <[email protected]>
--
Kind Regards
Mehdi Djait
Miguel Vadillo
maintainerPATCH v5 2/3 media: pci: intel: Add CVS support for IPU bridge driver
In reply to Miguel VadilloCVS is located between IPU device and sensors and is available in existing commercial platforms from multiple OEMs. The connection information between them in firmware is not enough to build a V4L2 connection graph. This patch parses the connection properties from the SSDB buffer in DSDT and builds the connection using software nodes.
From the IPU bridge point of view, CVS is just like IVSC.
--- drivers/media/pci/intel/ipu-bridge.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/media/pci/intel/ipu-bridge.c +11 -2
@@ -152,6 +152,9 @@ static const struct acpi_device_id ivsc_acpi_ids[] = { { "INTC1095" }, { "INTC100A" }, { "INTC10CF" }, + { "INTC10DE" }, /* LNL */ + { "INTC10E0" }, /* ARL */ + { "INTC10E1" }, /* PTL */ };static struct acpi_device *ipu_bridge_get_ivsc_acpi_dev (struct acpi_device *adev)
@@ -205,7 +208,13 @@ static struct device *ipu_bridge_get_ivsc_csi_dev(struct acpi_device *adev)return csi_dev; } -return NULL ; +/* Try to locate CVS device on the I2C bus */ + csi_dev =bus_find_device_by_acpi_dev (&i2c_bus_type, adev); +if (csi_dev) +return csi_dev; + +/* Fallback to platform bus for CVS device */ +return bus_find_device_by_acpi_dev (&platform_bus_type, adev); } static int ipu_bridge_check_ivsc_dev(struct ipu_sensor *sensor,
@@ -219,7 +228,7 @@ static int ipu_bridge_check_ivsc_dev(struct ipu_sensor *sensor, csi_dev =ipu_bridge_get_ivsc_csi_dev (adev);if (!csi_dev) {acpi_dev_put (adev); -dev_err (ADEV_DEV (adev),"Failed to find MEI CSI dev\n" ); +dev_err (ADEV_DEV (adev),"Failed to find MEI or CVS CSI dev\n" );return -ENODEV ; }
Signature · 1 line
2.43.0
Re: [PATCH v5 2/3] media: pci: intel: Add CVS support for IPU bridge driver
Hi Miguel,
Thank you for the patch!
Quoted 9 lines · Miguel Vadillo
CVS is located between IPU device and sensors and is available in existing commercial platforms from multiple OEMs. The connection information between them in firmware is not enough to build a V4L2 connection graph. This patch parses the connection properties from the SSDB buffer in DSDT and builds the connection using software nodes.
From the IPU bridge point of view, CVS is just like IVSC.
Signed-off-by Miguel Vadillo <[email protected]>
--
Kind Regards
Mehdi Djait
Miguel Vadillo
maintainerPATCH v5 3/3 ACPI: scan: Honor _DEP for Intel CVS devices
In reply to Miguel VadilloCVS (Computer Vision Sensing) is an ACPI-enumerated device that sits inline in the CSI-2 path between the camera sensor and Intel IPU. On platforms where CVS is present, the camera sensor's ACPI node declares a _DEP dependency on the CVS device.
The CVS driver must be fully initialized before camera sensor drivers probe, because CVS controls the CSI-2 link ownership handshake (via GPIO REQ/RESP), the MIPI/CSI-2 lane configuration, and the camera power domain. Without CVS ready, the sensor driver can bind but the CSI-2 stream will not function correctly.
The CVS driver calls acpi_dev_clear_dependencies() at the end of its probe() to unblock waiting consumers once it is ready.
Move the CVS HIDs from acpi_ignore_dep_ids[] to acpi_honor_dep_ids[] so that camera sensor enumeration is deferred until the CVS driver has finished probing, matching the behavior already in place for IVSC.
--- drivers/acpi/scan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/acpi/scan.c +3 -2
@@ -848,8 +848,6 @@ static bool acpi_info_matches_ids(struct acpi_device_info *info,static const char *const acpi_ignore_dep_ids[] = {"PNP0D80" ,/* Windows-compatible System Power Management Controller */ "INT33BD" ,/* Intel Baytrail Mailbox Device */ -"INTC10DE" ,/* Intel CVS LNL */ -"INTC10E0" ,/* Intel CVS ARL */ "LATT2021" ,/* Lattice FW Update Client Driver */ NULL };
@@ -861,6 +859,9 @@ static const char * const acpi_honor_dep_ids[] = {"INTC1095" ,/* IVSC (ADL) driver must be loaded to allow i2c access to camera sensors */ "INTC100A" ,/* IVSC (RPL) driver must be loaded to allow i2c access to camera sensors */ "INTC10CF" ,/* IVSC (MTL) driver must be loaded to allow i2c access to camera sensors */ +"INTC10DE" ,/* CVS (LNL) driver must be loaded to allow camera streaming */ +"INTC10E0" ,/* CVS (ARL) driver must be loaded to allow camera streaming */ +"INTC10E1" ,/* CVS (PTL) driver must be loaded to allow camera streaming */ "RSCV0001" ,/* RISC-V PLIC */ "RSCV0002" ,/* RISC-V APLIC */ "RSCV0005", /* RISC-V SBI MPXY MBOX */
Signature · 1 line
2.43.0
Re: [PATCH v5 3/3] ACPI: scan: Honor _DEP for Intel CVS devices
Hi Miguel,
Thank you for the patch!
Quoted 11 lines · Miguel Vadillo
CVS (Computer Vision Sensing) is an ACPI-enumerated device that sits inline in the CSI-2 path between the camera sensor and Intel IPU. On platforms where CVS is present, the camera sensor's ACPI node declares a
_DEPdependency on the CVS device.The CVS driver must be fully initialized before camera sensor drivers probe, because CVS controls the CSI-2 link ownership handshake (via GPIO REQ/RESP), the MIPI/CSI-2 lane configuration, and the camera power domain. Without CVS ready, the sensor driver can bind but the CSI-2 stream will not function correctly.
Quoted 8 lines
The CVS driver calls
acpi_dev_clear_dependencies()at the end of itsprobe()to unblock waiting consumers once it is ready.Move the CVS HIDs from acpi_ignore_dep_ids[] to acpi_honor_dep_ids[] so that camera sensor enumeration is deferred until the CVS driver has finished probing, matching the behavior already in place for IVSC.
Signed-off-by Miguel Vadillo <[email protected]>
--
Kind Regards
Mehdi Djait