@@ -73,6 +73,7 @@ config VIDEO_PCI_SKELETON
Enable build of the skeleton PCI driver, used as a reference
when developing new drivers.
+source "drivers/media/pci/intel/Kconfig"
source "drivers/media/pci/intel/ipu3/Kconfig"
endif #MEDIA_PCI_SUPPORT
new file mode 100644
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config IPU_BRIDGE
+ bool "Intel IPU Sensors Bridge"
+ depends on VIDEO_IPU3_CIO2 && ACPI
+ depends on I2C
+ help
+ This extension provides an API for the Intel IPU driver to create
+ connections to cameras that are hidden in the SSDB buffer in ACPI.
+ It can be used to enable support for cameras in detachable / hybrid
+ devices that ship with Windows.
+
+ Say Y here if your device is a detachable / hybrid laptop that comes
+ with Windows installed by the OEM, for example:
+
+ - Microsoft Surface models (except Surface Pro 3)
+ - The Lenovo Miix line (for example the 510, 520, 710 and 720)
+ - Dell 7285
+
+ If in doubt, say N here.
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
#
-# Makefile for the IPU3 cio2 and ImGU drivers
+# Makefile for the IPU drivers
#
-
+obj-$(CONFIG_IPU_BRIDGE) += ipu-bridge.o
obj-y += ipu3/
similarity index 99%
rename from drivers/media/pci/intel/ipu3/cio2-bridge.c
rename to drivers/media/pci/intel/ipu-bridge.c
@@ -8,7 +8,7 @@
#include <linux/property.h>
#include <media/v4l2-fwnode.h>
-#include "cio2-bridge.h"
+#include "ipu-bridge.h"
/*
* Extend this array with ACPI Hardware IDs of devices known to be working
@@ -431,7 +431,7 @@ static int cio2_bridge_sensors_are_ready(void)
return ready;
}
-int cio2_bridge_init(struct pci_dev *cio2)
+int ipu_bridge_init(struct pci_dev *cio2)
{
struct device *dev = &cio2->dev;
struct fwnode_handle *fwnode;
@@ -492,3 +492,4 @@ int cio2_bridge_init(struct pci_dev *cio2)
return ret;
}
+EXPORT_SYMBOL_NS_GPL(ipu_bridge_init, INTEL_IPU_BRIDGE);
similarity index 94%
rename from drivers/media/pci/intel/ipu3/cio2-bridge.h
rename to drivers/media/pci/intel/ipu-bridge.h
@@ -6,7 +6,7 @@
#include <linux/property.h>
#include <linux/types.h>
-#include "ipu3-cio2.h"
+#include "ipu3/ipu3-cio2.h"
struct i2c_client;
@@ -143,4 +143,10 @@ struct cio2_bridge {
struct cio2_sensor sensors[CIO2_NUM_PORTS];
};
+#if IS_ENABLED(CONFIG_IPU_BRIDGE)
+int ipu_bridge_init(struct pci_dev *cio2);
+#else
+static inline int ipu_bridge_init(struct pci_dev *cio2) { return 0; }
+#endif
+
#endif
@@ -17,22 +17,3 @@ config VIDEO_IPU3_CIO2
Say Y or M here if you have a Skylake/Kaby Lake SoC with MIPI CSI-2
connected camera.
The module will be called ipu3-cio2.
-
-config CIO2_BRIDGE
- bool "IPU3 CIO2 Sensors Bridge"
- depends on VIDEO_IPU3_CIO2 && ACPI
- depends on I2C
- help
- This extension provides an API for the ipu3-cio2 driver to create
- connections to cameras that are hidden in the SSDB buffer in ACPI.
- It can be used to enable support for cameras in detachable / hybrid
- devices that ship with Windows.
-
- Say Y here if your device is a detachable / hybrid laptop that comes
- with Windows installed by the OEM, for example:
-
- - Microsoft Surface models (except Surface Pro 3)
- - The Lenovo Miix line (for example the 510, 520, 710 and 720)
- - Dell 7285
-
- If in doubt, say N here.
@@ -2,4 +2,3 @@
obj-$(CONFIG_VIDEO_IPU3_CIO2) += ipu3-cio2.o
ipu3-cio2-y += ipu3-cio2-main.o
-ipu3-cio2-$(CONFIG_CIO2_BRIDGE) += cio2-bridge.o
@@ -29,6 +29,7 @@
#include <media/v4l2-ioctl.h>
#include <media/videobuf2-dma-sg.h>
+#include "../ipu-bridge.h"
#include "ipu3-cio2.h"
struct ipu3_cio2_fmt {
@@ -1727,7 +1728,7 @@ static int cio2_pci_probe(struct pci_dev *pci_dev,
return -EINVAL;
}
- r = cio2_bridge_init(pci_dev);
+ r = ipu_bridge_init(pci_dev);
if (r)
return r;
}
@@ -2060,3 +2061,4 @@ MODULE_AUTHOR("Yuning Pu <yuning.pu@intel.com>");
MODULE_AUTHOR("Yong Zhi <yong.zhi@intel.com>");
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("IPU3 CIO2 driver");
+MODULE_IMPORT_NS(INTEL_IPU_BRIDGE);
@@ -459,10 +459,4 @@ static inline struct cio2_queue *vb2q_to_cio2_queue(struct vb2_queue *vq)
return container_of(vq, struct cio2_queue, vbq);
}
-#if IS_ENABLED(CONFIG_CIO2_BRIDGE)
-int cio2_bridge_init(struct pci_dev *cio2);
-#else
-static inline int cio2_bridge_init(struct pci_dev *cio2) { return 0; }
-#endif
-
#endif