Commit 0edd95f2 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent ca24fef0
......@@ -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 @@ static int mipi_csis_probe(struct platform_device *pdev)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment