mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
media: Use conftest to find if struct v4l2_async_connection present
Use conftest to find if struct v4l2_async_connection present
or not. The struct v4l2_async_subdev is renamed to struct
v4l2_async_connection with change commit adb2dcd5f2d49d3
("media: v4l: async: Rename v4l2_async_subdev as v4l2_async_connection")
in Linux 6.5
Bug 4346767
Change-Id: Id15c8ce747a8642b7831b79f45e15f26e95744b2
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028744
(cherry picked from commit 234ba9c75f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053706
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
5b4a093e24
commit
afe9bdc7c0
3
Makefile
3
Makefile
@@ -24,9 +24,6 @@ endif
|
||||
|
||||
# Changes done in Linux 6.6 onwards
|
||||
ifeq ($(shell test $(LINUX_VERSION) -ge $(LINUX_VERSION_6_6); echo $$?),0)
|
||||
# v4l2_async_subdev is renamed to v4l2_async_connection.
|
||||
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
|
||||
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
/*
|
||||
* NVIDIA Media controller graph management
|
||||
*
|
||||
* Copyright (c) 2015-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* Copyright (c) 2015-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/of.h>
|
||||
@@ -341,7 +344,7 @@ register_device_error:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if defined(NV_V4L2_ASYNC_SUBDEV_RENAME)
|
||||
#if defined(NV_V4L2_ASYNC_CONNECTION_STRUCT_PRESENT) /* Linux 6.5 */
|
||||
static int tegra_vi_graph_notify_bound(struct v4l2_async_notifier *notifier,
|
||||
struct v4l2_subdev *subdev,
|
||||
struct v4l2_async_connection *asd)
|
||||
@@ -380,7 +383,7 @@ static int tegra_vi_graph_notify_bound(struct v4l2_async_notifier *notifier,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#if defined(NV_V4L2_ASYNC_SUBDEV_RENAME)
|
||||
#if defined(NV_V4L2_ASYNC_CONNECTION_STRUCT_PRESENT) /* Linux 6.5 */
|
||||
static void tegra_vi_graph_notify_unbind(struct v4l2_async_notifier *notifier,
|
||||
struct v4l2_subdev *subdev,
|
||||
struct v4l2_async_connection *asd)
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
/*
|
||||
* Tegra Media controller common APIs
|
||||
*
|
||||
* Copyright (c) 2012-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* Copyright (c) 2012-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __CAMERA_MC_COMMON_H__
|
||||
#define __CAMERA_MC_COMMON_H__
|
||||
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
#include <media/media-device.h>
|
||||
#include <media/media-entity.h>
|
||||
#include <media/sensor_common.h>
|
||||
@@ -94,7 +96,7 @@ struct tegra_vi_graph_entity {
|
||||
struct device_node *node;
|
||||
struct media_entity *entity;
|
||||
|
||||
#if defined(NV_V4L2_ASYNC_SUBDEV_RENAME)
|
||||
#if defined(NV_V4L2_ASYNC_CONNECTION_STRUCT_PRESENT) /* Linux 6.5 */
|
||||
struct v4l2_async_connection asd;
|
||||
#else
|
||||
struct v4l2_async_subdev asd;
|
||||
|
||||
@@ -150,6 +150,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_dev_iommu_get_stream_id
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_ivc_struct_has_iosys_map
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_write_has_u8_ptr_arg
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_set_termios_has_const_ktermios_arg
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_async_connection_struct_present
|
||||
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
|
||||
|
||||
@@ -7476,6 +7476,23 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_TTY_OPERATIONS_STRUCT_SET_TERMIOS_HAS_CONST_KTERMIOS_ARG" "" "types"
|
||||
;;
|
||||
|
||||
v4l2_async_connection_struct_present)
|
||||
#
|
||||
# Determine if the 'struct v4l2_async_connection' present or not.
|
||||
#
|
||||
# The struct v4l2_async_subdev is renamed to v4l2_async_connection with change
|
||||
# commit adb2dcd5f2d49d3 ("media: v4l: async: Rename v4l2_async_subdev
|
||||
# as v4l2_async_connection") in Linux 6.5
|
||||
#
|
||||
CODE="
|
||||
#include <media/v4l2-async.h>
|
||||
int conftest_v4l2_async_connection_struct_present(void) {
|
||||
return offsetof(struct v4l2_async_connection, match);
|
||||
}"
|
||||
|
||||
compile_check_conftest "$CODE" "NV_V4L2_ASYNC_CONNECTION_STRUCT_PRESENT" "" "types"
|
||||
;;
|
||||
|
||||
# When adding a new conftest entry, please use the correct format for
|
||||
# specifying the relevant upstream Linux kernel commit.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user