aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakari Ailus <[email protected]>2023-04-28 17:09:57 +0200
committerMauro Carvalho Chehab <[email protected]>2023-08-10 07:57:40 +0200
commit1e3454582e11e0108ad0743529461181f8476741 (patch)
treec653c83c3f79bb74929a28eeddcd881393d0c883
parente74f7a96787c46e90b3c8519d4e0d127f5cc106d (diff)
media: adv748x: Return to endpoint matching
Return the two CSI-2 transmitters of adv748x to endpoint matching. This should make the driver work again as expected. Fixes: 1029939b3782 ("media: v4l: async: Simplify async sub-device fwnode matching") Signed-off-by: Sakari Ailus <[email protected]> Tested-by: Philipp Zabel <[email protected]> # imx6qp Tested-by: Niklas Söderlund <[email protected]> # rcar + adv746x Tested-by: Aishwarya Kothari <[email protected]> # Apalis i.MX6Q with TC358743 Tested-by: Lad Prabhakar <[email protected]> # Renesas RZ/G2L SMARC Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/media/i2c/adv748x/adv748x-csi2.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/media/i2c/adv748x/adv748x-csi2.c b/drivers/media/i2c/adv748x/adv748x-csi2.c
index b6f93c1db3d2..a5a7cb228896 100644
--- a/drivers/media/i2c/adv748x/adv748x-csi2.c
+++ b/drivers/media/i2c/adv748x/adv748x-csi2.c
@@ -296,8 +296,6 @@ int adv748x_csi2_init(struct adv748x_state *state, struct adv748x_csi2 *tx)
if (!is_tx_enabled(tx))
return 0;
- /* FIXME: Do endpoint matching again! */
-
adv748x_subdev_init(&tx->sd, state, &adv748x_csi2_ops,
MEDIA_ENT_F_VID_IF_BRIDGE,
is_txa(tx) ? "txa" : "txb");
@@ -313,10 +311,15 @@ int adv748x_csi2_init(struct adv748x_state *state, struct adv748x_csi2 *tx)
if (ret)
return ret;
- ret = adv748x_csi2_init_controls(tx);
+ ret = v4l2_async_subdev_endpoint_add(&tx->sd,
+ of_fwnode_handle(state->endpoints[tx->port]));
if (ret)
goto err_free_media;
+ ret = adv748x_csi2_init_controls(tx);
+ if (ret)
+ goto err_cleanup_subdev;
+
ret = v4l2_async_register_subdev(&tx->sd);
if (ret)
goto err_free_ctrl;
@@ -325,6 +328,8 @@ int adv748x_csi2_init(struct adv748x_state *state, struct adv748x_csi2 *tx)
err_free_ctrl:
v4l2_ctrl_handler_free(&tx->ctrl_hdl);
+err_cleanup_subdev:
+ v4l2_subdev_cleanup(&tx->sd);
err_free_media:
media_entity_cleanup(&tx->sd.entity);
@@ -339,4 +344,5 @@ void adv748x_csi2_cleanup(struct adv748x_csi2 *tx)
v4l2_async_unregister_subdev(&tx->sd);
media_entity_cleanup(&tx->sd.entity);
v4l2_ctrl_handler_free(&tx->ctrl_hdl);
+ v4l2_subdev_cleanup(&tx->sd);
}