diff --git a/drivers/media/platform/tegra/camera/csi/csi.c b/drivers/media/platform/tegra/camera/csi/csi.c index 0bec4d59..fae679f5 100644 --- a/drivers/media/platform/tegra/camera/csi/csi.c +++ b/drivers/media/platform/tegra/camera/csi/csi.c @@ -2,9 +2,11 @@ /* * NVIDIA Tegra CSI Device * - * Copyright (c) 2015-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-2024, NVIDIA CORPORATION. All rights reserved. */ +#include + #include #include #include @@ -685,6 +687,9 @@ static int tegra_csi_set_format(struct v4l2_subdev *subdev, } static int tegra_csi_g_frame_interval(struct v4l2_subdev *sd, +#if defined(NV_V4L2_SUBDEV_PAD_OPS_STRUCT_HAS_GET_FRAME_INTERVAL) + struct v4l2_subdev_state *sd_state, +#endif struct v4l2_subdev_frame_interval *vfi) { struct tegra_csi_channel *chan = to_csi_chan(sd); @@ -716,10 +721,15 @@ static int tegra_csi_enum_mbus_code(struct v4l2_subdev *sd, static struct v4l2_subdev_video_ops tegra_csi_video_ops = { .s_stream = tegra_csi_s_stream, .g_input_status = tegra_csi_g_input_status, +#if !defined(NV_V4L2_SUBDEV_PAD_OPS_STRUCT_HAS_GET_FRAME_INTERVAL) .g_frame_interval = tegra_csi_g_frame_interval, +#endif }; static struct v4l2_subdev_pad_ops tegra_csi_pad_ops = { +#if defined(NV_V4L2_SUBDEV_PAD_OPS_STRUCT_HAS_GET_FRAME_INTERVAL) + .get_frame_interval = tegra_csi_g_frame_interval, +#endif .get_fmt = tegra_csi_get_format, .set_fmt = tegra_csi_set_format, .enum_mbus_code = tegra_csi_enum_mbus_code, diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 8b82b5af..d8ed12a4 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -156,6 +156,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_async_connection_struct_present NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_async_match_type_enum_present NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_async_subdev_nf_init NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_async_notifier_init +NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_subdev_pad_ops_struct_has_get_frame_interval NV_CONFTEST_FUNCTION_COMPILE_TESTS += vm_area_struct_has_const_vm_flags NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_fd_to_handle NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_handle_to_fd diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 2faed1c9..64d58ffa 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -7581,6 +7581,25 @@ compile_test() { compile_check_conftest "$CODE" "NV_V4L2_ASYNC_NOTIFIER_INIT_PRESENT" "" "functions" ;; + v4l2_subdev_pad_ops_struct_has_get_frame_interval) + # + # Determine if struct v4l2_subdev_pad_ops has the 'get_frame_interval' + # function pointer. + # + # Added by commit 287fe160834a ("media: v4l2-subdev: Turn + # .[gs]_frame_interval into pad operations") in Linux v6.8. + # + CODE=" + #define _LINUX_EFI_H + #include + int conftest_v4l2_subdev_pad_ops_struct_has_get_set_frame_interval(void) { + return offsetof(struct v4l2_subdev_pad_ops, get_frame_interval); + } + " + compile_check_conftest "$CODE" \ + "NV_V4L2_SUBDEV_PAD_OPS_STRUCT_HAS_GET_FRAME_INTERVAL" "" "types" + ;; + crypto_engine_ctx_struct_removed_test) # # Determine if struct 'crypto_engine_ctx' is removed in linux kernel.