]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: i2c: Defer ov5670_probe() if endpoint not found
authorDaniel Scally <dan.scally@ideasonboard.com>
Tue, 20 May 2025 13:17:44 +0000 (14:17 +0100)
committerHans Verkuil <hverkuil@xs4all.nl>
Mon, 30 Jun 2025 06:47:41 +0000 (08:47 +0200)
The OV5670 is found on a Dell 7212, coupled to Intel's CIO2 CSI-2
receiver. The ACPI tables don't describe the connection properly and
so this is one of the sensors that needs to wait for the ipu-bridge
to set up the graph with software nodes. Defer probe if an endpoint
isn't found to allow time for that.

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/ov5670.c

index c54bbc2071899d30fa6b097c44a40148d9f4209b..b9efb2d2276a8593a9003e9bd23934a8d25f2d54 100644 (file)
@@ -2688,10 +2688,15 @@ static int ov5670_probe(struct i2c_client *client)
        if (ret)
                return dev_err_probe(&client->dev, ret, "GPIO probe failed\n");
 
-       /* Graph Endpoint */
+       /*
+        * Graph Endpoint. If it's missing we defer rather than fail, as this
+        * sensor is known to co-exist on systems with the IPU3 and so it might
+        * be created by the ipu-bridge.
+        */
        handle = fwnode_graph_get_next_endpoint(dev_fwnode(&client->dev), NULL);
        if (!handle)
-               return dev_err_probe(&client->dev, -ENXIO, "Endpoint for node get failed\n");
+               return dev_err_probe(&client->dev, -EPROBE_DEFER,
+                                    "Endpoint for node get failed\n");
 
        ov5670->endpoint.bus_type = V4L2_MBUS_CSI2_DPHY;
        ov5670->endpoint.bus.mipi_csi2.num_data_lanes = 2;