From ea944b676dfcbdec7339d5039c68e4903534cc04 Mon Sep 17 00:00:00 2001 From: Iurii Sintiaev Date: Thu, 25 Dec 2025 16:45:43 +0000 Subject: [PATCH] media: i2c: ov9281: Fix async subdev matching for Rockchip CSI2 DPHY The Rockchip CSI2 DPHY driver expects sensors to register with endpoint fwnode for async matching to work. The ov9281 driver was using v4l2_async_register_subdev_sensor() which registers with device fwnode, causing the async matching to fail. Fix this by explicitly setting sd->fwnode to the endpoint fwnode before registration and using v4l2_async_register_subdev() instead. Without this fix, the sensor is never bound to the DPHY and camera capture fails on Rockchip RK3588 based boards like Radxa CM5. Tested on Radxa CM5 IO Board with OV9281 camera module. Signed-off-by: Iurii Sintiaev --- drivers/media/i2c/ov9281.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov9281.c b/drivers/media/i2c/ov9281.c index b0566ac8a21e9..a909b9ed7a408 100644 --- a/drivers/media/i2c/ov9281.c +++ b/drivers/media/i2c/ov9281.c @@ -1355,7 +1355,17 @@ static int ov9281_probe(struct i2c_client *client, snprintf(sd->name, sizeof(sd->name), "m%02d_%s_%s %s", ov9281->module_index, facing, OV9281_NAME, dev_name(sd->dev)); - ret = v4l2_async_register_subdev_sensor(sd); + { + struct fwnode_handle *ep; + ep = fwnode_graph_get_next_endpoint(dev_fwnode(dev), NULL); + if (ep) { + dev_info(dev, "Manually found endpoint: %px\n", ep); + sd->fwnode = ep; + }else{ + dev_err(dev, "Could not find ep!\n"); + } + } + ret = v4l2_async_register_subdev(sd); if (ret) { dev_err(dev, "v4l2 async register subdev failed\n"); goto err_clean_entity;