Skip to content

Commit ccdfcb9

Browse files
Arnd Bergmanngregkh
Arnd Bergmann
authored andcommitted
media: ipu3-cio2: allow ipu_bridge to be a module again
commit 2545a2c upstream. This code was previously part of the VIDEO_IPU3_CIO2 driver, which could be built-in or a loadable module, but after the move it turned into a builtin-only driver. This fails to link when the I2C subsystem is a module: x86_64-linux-ld: drivers/media/pci/intel/ipu-bridge.o: in function `ipu_bridge_unregister_sensors': ipu-bridge.c:(.text+0x50): undefined reference to `i2c_unregister_device' x86_64-linux-ld: drivers/media/pci/intel/ipu-bridge.o: in function `ipu_bridge_init': ipu-bridge.c:(.text+0x9c9): undefined reference to `i2c_acpi_new_device_by_fwnode' In general, drivers should not have to be built-in, so change the option to a tristate with the corresponding dependency. This in turn opens a new problem with the dependency, as the IPU bridge can be a loadable module while the ipu3 driver itself is built-in, producing a new link failure: 86_64-linux-ld: drivers/media/pci/intel/ipu3/ipu3-cio2.o: in function `cio2_pci_probe': ipu3-cio2.c:(.text+0x197e): undefined reference to `ipu_bridge_init' In order to fix this, restore the old Kconfig option that controlled the ipu bridge driver before it was split out, but make it select a hidden symbol that now corresponds to the bridge driver. When other drivers get added that share ipu-bridge, this should cover all corner cases, and allow any combination of them to be built-in or modular. Link: https://lore.kernel.org/linux-media/[email protected] Fixes: 881ca25 ("media: ipu3-cio2: rename cio2 bridge to ipu bridge and move out of ipu3")' Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f51d194 commit ccdfcb9

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

drivers/media/pci/intel/Kconfig

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
config IPU_BRIDGE
3-
bool "Intel IPU Sensors Bridge"
4-
depends on VIDEO_IPU3_CIO2 && ACPI
5-
depends on I2C
3+
tristate
4+
depends on I2C && ACPI
65
help
7-
This extension provides an API for the Intel IPU driver to create
8-
connections to cameras that are hidden in the SSDB buffer in ACPI.
9-
It can be used to enable support for cameras in detachable / hybrid
10-
devices that ship with Windows.
11-
12-
Say Y here if your device is a detachable / hybrid laptop that comes
13-
with Windows installed by the OEM, for example:
14-
15-
- Microsoft Surface models (except Surface Pro 3)
16-
- The Lenovo Miix line (for example the 510, 520, 710 and 720)
17-
- Dell 7285
18-
19-
If in doubt, say N here.
6+
This is a helper module for the IPU bridge, which can be
7+
used by ipu3 and other drivers. In order to handle module
8+
dependencies, this is selected by each driver that needs it.
209

2110
source "drivers/media/pci/intel/ipu3/Kconfig"

drivers/media/pci/intel/ipu-bridge.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,3 +497,6 @@ int ipu_bridge_init(struct pci_dev *ipu)
497497
return ret;
498498
}
499499
EXPORT_SYMBOL_NS_GPL(ipu_bridge_init, INTEL_IPU_BRIDGE);
500+
501+
MODULE_LICENSE("GPL");
502+
MODULE_DESCRIPTION("Intel IPU Sensors Bridge driver");

drivers/media/pci/intel/ipu3/Kconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ config VIDEO_IPU3_CIO2
88
select VIDEO_V4L2_SUBDEV_API
99
select V4L2_FWNODE
1010
select VIDEOBUF2_DMA_SG
11+
select IPU_BRIDGE if CIO2_BRIDGE
1112

1213
help
1314
This is the Intel IPU3 CIO2 CSI-2 receiver unit, found in Intel
@@ -17,3 +18,22 @@ config VIDEO_IPU3_CIO2
1718
Say Y or M here if you have a Skylake/Kaby Lake SoC with MIPI CSI-2
1819
connected camera.
1920
The module will be called ipu3-cio2.
21+
22+
config CIO2_BRIDGE
23+
bool "IPU3 CIO2 Sensors Bridge"
24+
depends on VIDEO_IPU3_CIO2 && ACPI
25+
depends on I2C
26+
help
27+
This extension provides an API for the ipu3-cio2 driver to create
28+
connections to cameras that are hidden in the SSDB buffer in ACPI.
29+
It can be used to enable support for cameras in detachable / hybrid
30+
devices that ship with Windows.
31+
32+
Say Y here if your device is a detachable / hybrid laptop that comes
33+
with Windows installed by the OEM, for example:
34+
35+
- Microsoft Surface models (except Surface Pro 3)
36+
- The Lenovo Miix line (for example the 510, 520, 710 and 720)
37+
- Dell 7285
38+
39+
If in doubt, say N here.

0 commit comments

Comments
 (0)