diff --git a/drivers/scsi/ufs/ufs-tegra-common.c b/drivers/scsi/ufs/ufs-tegra-common.c index b49c5ece..eac93d53 100644 --- a/drivers/scsi/ufs/ufs-tegra-common.c +++ b/drivers/scsi/ufs/ufs-tegra-common.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only -// Copyright (c) 2015-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// Copyright (c) 2015-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +#include #include @@ -1903,7 +1905,7 @@ static struct ufs_tegra_soc_data tegra234_soc_data = { .chip_id = TEGRA234, }; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) +#if defined(NV_TEGRA264_CHIP_ID_PRESENT) /* Linux v6.5 */ static struct ufs_tegra_soc_data tegra264_soc_data = { .chip_id = TEGRA264, }; @@ -1916,7 +1918,7 @@ static const struct of_device_id ufs_tegra_of_match[] = { }, { .compatible = "tegra234,ufs_variant", .data = &tegra234_soc_data, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) +#if defined(NV_TEGRA264_CHIP_ID_PRESENT) /* Linux v6.5 */ }, { .compatible = "tegra264,ufs_variant", .data = &tegra264_soc_data, diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 26e30372..a07915a2 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -148,6 +148,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_rtd_to_codec NV_CONFTEST_FUNCTION_COMPILE_TESTS += simple_util_dai_init NV_CONFTEST_FUNCTION_COMPILE_TESTS += spi_get_chipselect NV_CONFTEST_FUNCTION_COMPILE_TESTS += tc_taprio_qopt_offload_struct_has_cmd +NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra264_chip_id 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 diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 1f87bc0b..0bdb3684 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -7439,6 +7439,22 @@ compile_test() { compile_check_conftest "$CODE" "NV_TC_TAPRIO_QOPT_OFFLOAD_STRUCT_HAS_CMD" "" "types" ;; + tegra264_chip_id) + # + # Determine if the 'TEGRA264' definition is present. + # + # Added by commit d94436465152 ("soc/tegra: fuse: Add support for + # Tegra264") in Linux v6.5. + # + CODE=" + #include + u8 conftest_tegra264_chip_id(void) { + return TEGRA264; + }" + + compile_check_conftest "$CODE" "NV_TEGRA264_CHIP_ID_PRESENT" "" "types" + ;; + tegra_ivc_struct_has_iosys_map) # # Determine if the 'tegra_ivc' structure has the 'map' argument.