diff --git a/Makefile b/Makefile index 24c89e3e..d1732e11 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,9 @@ subdir-ccflags-y += -DNV_V4L2_ASYNC_SUBDEV_RENAME # Rename V4L2_ASYNC_MATCH_FWNODE to V4L2_ASYNC_MATCH_TYPE_FWNODE subdir-ccflags-y += -DNV_V4L2_ASYNC_MATCH_FWNODE_RENAME + +# Rename async_nf_init and v4l2_async_subdev_nf_register +subdir-ccflags-y += -DNV_V4L2_ASYNC_NF_SUBDEVICE_INIT_RENAME endif ifeq ($(CONFIG_TEGRA_VIRTUALIZATION),y) diff --git a/drivers/media/platform/tegra/camera/vi/graph.c b/drivers/media/platform/tegra/camera/vi/graph.c index 78cf8e45..dc14fe4e 100644 --- a/drivers/media/platform/tegra/camera/vi/graph.c +++ b/drivers/media/platform/tegra/camera/vi/graph.c @@ -668,10 +668,23 @@ int tegra_vi_graph_init(struct tegra_mc_vi *vi) v4l2_async_notifier_init(&chan->notifier); list_for_each_entry(entity, &chan->entities, list) __v4l2_async_notifier_add_subdev(&chan->notifier, &entity->asd); +#else +#if defined (NV_V4L2_ASYNC_NF_SUBDEVICE_INIT_RENAME) + v4l2_async_subdev_nf_init(&chan->notifier, tegra_channel_find_linked_csi_subdev(chan)); + list_for_each_entry(entity, &chan->entities, list) { + struct v4l2_async_connection *asd; + asd = v4l2_async_nf_add_fwnode_remote(&chan->notifier, of_fwnode_handle(remote), + struct v4l2_async_connection); + if (IS_ERR(asd)) { + ret = PTR_ERR(asd); + goto done; + } + } #else v4l2_async_nf_init(&chan->notifier); list_for_each_entry(entity, &chan->entities, list) __v4l2_async_nf_add_subdev(&chan->notifier, &entity->asd); +#endif #endif chan->link_status = 0; @@ -681,10 +694,14 @@ int tegra_vi_graph_init(struct tegra_mc_vi *vi) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) ret = v4l2_async_notifier_register(&vi->v4l2_dev, &chan->notifier); +#else +#if defined (NV_V4L2_ASYNC_NF_SUBDEVICE_INIT_RENAME) + ret = v4l2_async_nf_register(&chan->notifier); #else ret = v4l2_async_nf_register(&vi->v4l2_dev, &chan->notifier); #endif +#endif #else dev_err(vi->dev, "CONFIG_V4L2_ASYNC is not enabled!\n"); ret = -ENOTSUPP;