media: intel: rename and move cio2-bridge out of ipu3
Subsystems (2)
PATCH 1/1 media: intel: rename and move cio2-bridge out of ipu3
From: Bingbu Cao <[email protected]>
cio2 bridge was involved along with IPU3. However, in fact all Intel IPUs besides IPU3 CIO2 need this bridge driver. This patch move bridge driver out of ipu3 directory and rename as ipu-bridge. Then it can be worked with IPU3 and other Intel IPUs.
---
drivers/media/pci/Kconfig | 1 +
drivers/media/pci/intel/Kconfig | 19 +++++++++++++++++++
drivers/media/pci/intel/Makefile | 4 ++--
.../{ipu3/cio2-bridge.c => ipu-bridge.c} | 5 +++--
.../{ipu3/cio2-bridge.h => ipu-bridge.h} | 8 +++++++-
drivers/media/pci/intel/ipu3/Kconfig | 19 -------------------
drivers/media/pci/intel/ipu3/Makefile | 1 -
drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 4 +++-
drivers/media/pci/intel/ipu3/ipu3-cio2.h | 6 ------
9 files changed, 35 insertions(+), 32 deletions(-)
create mode 100644 drivers/media/pci/intel/Kconfig
rename drivers/media/pci/intel/{ipu3/cio2-bridge.c => ipu-bridge.c} (99%)
rename drivers/media/pci/intel/{ipu3/cio2-bridge.h => ipu-bridge.h} (94%)drivers/media/pci/Kconfig +1 -0
@@ -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
drivers/media/pci/intel/Kconfig new file +19 -0
@@ -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.
drivers/media/pci/intel/Makefile +2 -2
@@ -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/
drivers/media/pci/intel/ipu-bridge.c renamed from drivers/media/pci/intel/ipu3/cio2-bridge.c +3 -2
@@ -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 );
drivers/media/pci/intel/ipu-bridge.h renamed from drivers/media/pci/intel/ipu3/cio2-bridge.h +7 -1
@@ -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
drivers/media/pci/intel/ipu3/Kconfig +0 -19
@@ -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.
drivers/media/pci/intel/ipu3/Makefile +0 -1
@@ -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
drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +3 -1
@@ -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 <[email protected]>");MODULE_AUTHOR ("Yong Zhi <[email protected]>" );MODULE_LICENSE ("GPL v2" );MODULE_DESCRIPTION ("IPU3 CIO2 driver" ); +MODULE_IMPORT_NS (INTEL_IPU_BRIDGE );
drivers/media/pci/intel/ipu3/ipu3-cio2.h +0 -6
@@ -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
Signature · 1 line
2.40.1
Sakari Ailus
maintainerHi Bingbu,
Thanks for the patch.
Quoted 8 lines · On Wed, May 17, 2023 at 06:30:04PM +0800, [email protected] wrote:
From: Bingbu Cao <[email protected]>
cio2 bridge was involved along with IPU3. However, in fact all Intel IPUs besides IPU3 CIO2 need this bridge driver. This patch move bridge driver out of ipu3 directory and rename as ipu-bridge. Then it can be worked with IPU3 and other Intel IPUs.
Signed-off-by Bingbu Cao <[email protected]>
Could you also rename the names used internally? I.e. cio -> ipu? But not renaming actual CIO2 dependencies, they should be handled in separate patch (or patches). It'd be nice to see them in the same set.
Signature · 3 lines
Kind regards, Sakari Ailus