diff --git a/drivers/media/platform/tegra/camera/camera_common.c b/drivers/media/platform/tegra/camera/camera_common.c index 05143855..5c74bba1 100644 --- a/drivers/media/platform/tegra/camera/camera_common.c +++ b/drivers/media/platform/tegra/camera/camera_common.c @@ -4,6 +4,9 @@ * * Copyright (c) 2015-2024, NVIDIA CORPORATION. All rights reserved. */ + +#include + #include #include #include @@ -875,12 +878,17 @@ void camera_common_dpd_disable(struct camera_common_data *s_data) } if (atomic_inc_return( &camera_common_csi_io_pads[io_idx].ref) == 1) { +#if defined(NV_TEGRA264_IO_PAD_POWER_ENABLE_PRESENT) if (__tegra_get_chip_id() == TEGRA264) tegra264_io_pad_power_enable(s_data->dev, TEGRA_IO_PAD_CSIA + io_idx); else tegra_io_pad_power_enable( TEGRA_IO_PAD_CSIA + io_idx); +#else + tegra_io_pad_power_enable( + TEGRA_IO_PAD_CSIA + io_idx); +#endif } dev_dbg(s_data->dev, @@ -906,12 +914,17 @@ void camera_common_dpd_enable(struct camera_common_data *s_data) } if (atomic_dec_return( &camera_common_csi_io_pads[io_idx].ref) == 0) { +#if defined(NV_TEGRA264_IO_PAD_POWER_ENABLE_PRESENT) if (__tegra_get_chip_id() == TEGRA264) tegra264_io_pad_power_disable(s_data->dev, TEGRA_IO_PAD_CSIA + io_idx); else tegra_io_pad_power_disable( TEGRA_IO_PAD_CSIA + io_idx); +#else + tegra_io_pad_power_disable( + TEGRA_IO_PAD_CSIA + io_idx); +#endif } dev_dbg(s_data->dev, diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 9d53dd2e..dfb24469 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -187,6 +187,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += spi_driver_struct_remove_return_type_int 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 += tegra264_io_pad_power_enable 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 += tegra_ivc_use_ivc_ext_driver diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index a021ee62..0e1c7038 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -8143,6 +8143,20 @@ compile_test() { compile_check_conftest "$CODE" "NV_TEGRA264_CHIP_ID_PRESENT" "" "types" ;; + tegra264_io_pad_power_enable) + # + # Determine if tegra264_io_pad_power_enable() exists or not + # + CODE=" + #include + int conftest_tegra264_io_pad_power_enable(void) { + tegra264_io_pad_power_enable(); + } + " + + compile_check_conftest "$CODE" "NV_TEGRA264_IO_PAD_POWER_ENABLE_PRESENT" "" "functions" + ;; + tegra_ivc_struct_has_iosys_map) # # Determine if the 'tegra_ivc' structure has the 'map' argument.