diff mbox series

[v2,13/13] media: ipu3-cio2: Add module soft-deps for the INT3472 drivers

Message ID 20211009160548.306550-14-hdegoede@redhat.com (mailing list archive)
State Superseded, archived
Headers show
Series Add support for X86/ACPI camera sensor/PMIC setup with clk and regulator platform data | expand

Commit Message

Hans de Goede Oct. 9, 2021, 4:05 p.m. UTC
The clk and regulator frameworks expect clk/regulator consumer-devices
to have info about the consumed clks/regulators described in the device's
fw_node.

To work around this info missing from the ACPI tables on devices where
the int3472 driver is used, the int3472 MFD-cell drivers attach info about
consumers to the clks/regulators when registering these.

This causes problems with the probe ordering wrt drivers for consumers
of these clks/regulators. Since the lookups are only registered when the
provider-driver binds, trying to get these clks/regulators before then
results in a -ENOENT error for clks and a dummy regulator for regulators.

All the sensor ACPI fw-nodes have a _DEP dependency on the INT3472 ACPI
fw-node, so to work around these probe ordering issues the ACPI core
reports status.present and status.enabled as false for any ACPI devices
which have a dependency on an INT3472 ACPI device until all _DEP-s are met.

Our sensor-detect code in cio2-bridge.c depends on the status.present /
status.enabled fields. So the INT3472 driver (which fullfills the _DEP-s)
must be loaded before us to ensure the sensor-detect code works.
Add module soft-deps on the INT3472 drivers to ensure that they are loaded
first.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
index 7bb86e246ebe..4db6b637f555 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
@@ -2063,3 +2063,9 @@  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");
+/*
+ * The sensor detection in cio2-bridge.c relies on adev->status.present/enabled
+ * which will only be true for sensors if their _DEP dependencies are met, which
+ * requires the INT3472 drivers to have loaded.
+ */
+MODULE_SOFTDEP("pre: intel_skl_int3472_discrete intel_skl_int3472_tps68470");