diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-03-21 10:58:14 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-07-16 10:42:35 +0300 |
commit | 0edd95f25e31d51cceb17945e2ad801eb481b1a1 (patch) | |
tree | d6f71aa3135982616b8a29ceb70fd09e08626b2d /drivers/media/platform/nxp | |
parent | ca24fef0f2c857b0533f21f9a8a756f9e73d60fb (diff) | |
download | linux-0edd95f25e31d51cceb17945e2ad801eb481b1a1.tar.xz |
media: imx: imx-mipi-csis: Set the subdev fwnode for endpoint matching
Endpoint matching is preferred over device matching with the async
notifier framework. Set the fwnode in the v4l2_subdev for the CSIS to
the endpoint connected to the next device.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/nxp')
-rw-r--r-- | drivers/media/platform/nxp/imx-mipi-csis.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c index 80b1c021d14a..09a220c1bfe8 100644 --- a/drivers/media/platform/nxp/imx-mipi-csis.c +++ b/drivers/media/platform/nxp/imx-mipi-csis.c @@ -1378,6 +1378,13 @@ static int mipi_csis_subdev_init(struct mipi_csis_device *csis) sd->dev = csis->dev; + sd->fwnode = fwnode_graph_get_endpoint_by_id(dev_fwnode(csis->dev), + 1, 0, 0); + if (!sd->fwnode) { + dev_err(csis->dev, "Unable to retrieve endpoint for port@1\n"); + return -ENOENT; + } + csis->csis_fmt = &mipi_csis_formats[0]; mipi_csis_init_cfg(sd, NULL); @@ -1498,6 +1505,7 @@ cleanup: v4l2_async_unregister_subdev(&csis->sd); disable_clock: mipi_csis_clk_disable(csis); + fwnode_handle_put(csis->sd.fwnode); mutex_destroy(&csis->lock); return ret; @@ -1517,6 +1525,7 @@ static int mipi_csis_remove(struct platform_device *pdev) mipi_csis_runtime_suspend(&pdev->dev); mipi_csis_clk_disable(csis); media_entity_cleanup(&csis->sd.entity); + fwnode_handle_put(csis->sd.fwnode); mutex_destroy(&csis->lock); pm_runtime_set_suspended(&pdev->dev); |