On Thu Aug 27 15:33:36 2026 +0300, Antti Laakso wrote:
> Enable support for Intel IPU 7 and IPU 7.5, found in Lunar lake and
> Panther lake, respectively, in the ipu6 driver.
> 
> Disabling the CONFIG_VIDEO_INTEL_IPU6_IPU7 Kconfig option can be used to
> still default the support of IPU7 and 7.5 to the ipu7 driver, while
> default is enabled. The driver binding can still be configured at runtime
> by using force_probe and force_no_ipu7_probe options in ipu6 and ipu7
> drivers, respectively.
> 
> Signed-off-by: Antti Laakso <[email protected]>
> Co-developed-by: Sakari Ailus <[email protected]>
> Signed-off-by: Sakari Ailus <[email protected]>

Patch committed.

Thanks,
Sakari Ailus

 drivers/media/pci/intel/ipu6/Kconfig | 9 +++++++++
 drivers/media/pci/intel/ipu6/ipu6.c  | 8 ++++++++
 drivers/staging/media/ipu7/ipu7.c    | 7 +++++++
 include/media/ipu6-pci-table.h       | 2 ++
 4 files changed, 26 insertions(+)

---

diff --git a/drivers/media/pci/intel/ipu6/Kconfig 
b/drivers/media/pci/intel/ipu6/Kconfig
index 1129e2beb4be..a1d036a78b57 100644
--- a/drivers/media/pci/intel/ipu6/Kconfig
+++ b/drivers/media/pci/intel/ipu6/Kconfig
@@ -16,3 +16,12 @@ config VIDEO_INTEL_IPU6
 
          To compile this driver, say Y here! It contains 2 modules -
          intel_ipu6 and intel_ipu6_isys.
+
+config VIDEO_INTEL_IPU6_IPU7
+       bool "Support IPU 7 and IPU 7.5 in ipu6 driver by default"
+       depends on VIDEO_INTEL_IPU6
+       default y
+       help
+         Support Intel IPU 7 and IPU 7.5 in ipu6 driver by default, instead of
+         the ipu7 staging driver. This behaviour can be changed at runtime with
+         module parameters in the respective drivers.
diff --git a/drivers/media/pci/intel/ipu6/ipu6.c 
b/drivers/media/pci/intel/ipu6/ipu6.c
index 74f9cf96410f..43d951735f72 100644
--- a/drivers/media/pci/intel/ipu6/ipu6.c
+++ b/drivers/media/pci/intel/ipu6/ipu6.c
@@ -39,6 +39,10 @@
 #define IPU6_PCI_BAR           0
 #define IPU7_PCI_PBBAR         4
 
+static int force_no_probe_ipu7 = !IS_BUILTIN(CONFIG_VIDEO_INTEL_IPU6_IPU7);
+module_param(force_no_probe_ipu7, int, 0644);
+MODULE_PARM_DESC(force_no_probe_ipu7, "Don't probe ipu7 and ipu7.5 devices");
+
 struct ipu6_cell_program {
        u32 magic_number;
 
@@ -612,6 +616,10 @@ static int ipu6_pci_probe(struct pci_dev *pdev, const 
struct pci_device_id *id)
        unsigned long dir;
        int ret;
 
+       if ((id->device == PCI_DEVICE_ID_INTEL_IPU7 ||
+            id->device == PCI_DEVICE_ID_INTEL_IPU7P5) && force_no_probe_ipu7)
+               return -ENODEV;
+
        isp = devm_kzalloc(dev, sizeof(*isp), GFP_KERNEL);
        if (!isp)
                return -ENOMEM;
diff --git a/drivers/staging/media/ipu7/ipu7.c 
b/drivers/staging/media/ipu7/ipu7.c
index 48a35bda4237..88e362c7ae35 100644
--- a/drivers/staging/media/ipu7/ipu7.c
+++ b/drivers/staging/media/ipu7/ipu7.c
@@ -39,6 +39,10 @@
 #define IPU_PCI_BAR            0
 #define IPU_PCI_PBBAR          4
 
+static int force_probe = !IS_BUILTIN(CONFIG_VIDEO_INTEL_IPU6_IPU7);
+module_param(force_probe, int, 0644);
+MODULE_PARM_DESC(force_probe, "Probe ipu7 and ipu7.5 with this driver instead 
of ipu6");
+
 static const unsigned int ipu7_csi_offsets[] = {
        IPU_CSI_PORT_A_ADDR_OFFSET,
        IPU_CSI_PORT_B_ADDR_OFFSET,
@@ -2414,6 +2418,9 @@ static int ipu7_pci_probe(struct pci_dev *pdev, const 
struct pci_device_id *id)
        u32 is_es;
        int ret;
 
+       if (!force_probe)
+               return -ENODEV;
+
        if (!fwnode || fwnode_property_read_u32(fwnode, "is_es", &is_es))
                is_es = 0;
 
diff --git a/include/media/ipu6-pci-table.h b/include/media/ipu6-pci-table.h
index cd5b941fb96c..cacb8a3170d0 100644
--- a/include/media/ipu6-pci-table.h
+++ b/include/media/ipu6-pci-table.h
@@ -24,6 +24,8 @@ static const struct pci_device_id ipu6_pci_tbl[] = {
        { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IPU6EP_ADLN) },
        { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IPU6EP_RPLP) },
        { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IPU6EP_MTL) },
+       { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IPU7) },
+       { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IPU7P5) },
        { }
 };
 
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to