From fd42ccc45def49fb3db5e98fd773fa90b8b32b29 Mon Sep 17 00:00:00 2001 From: Johnny Liu Date: Thu, 22 May 2025 03:51:41 +0000 Subject: [PATCH] conftest: add devfreq_has_suspend_freq test Bug 5297893 Change-Id: I74388d308fdeb6673ecd7b6354971285ba6e3aa0 Signed-off-by: Johnny Liu Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3369019 Reviewed-by: mobile promotions Tested-by: mobile promotions Reviewed-by: Rajesh Devaraj Reviewed-by: Vijayakumar Subbu GVS: buildbot_gerritrpt --- scripts/conftest/Makefile | 1 + scripts/conftest/conftest.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index d4b83096..13531c3e 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -113,6 +113,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += clk_hw_determine_rate_no_reparent NV_CONFTEST_FUNCTION_COMPILE_TESTS += define_semaphore_has_number_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += devfreq_dev_profile_has_is_cooling_device NV_CONFTEST_FUNCTION_COMPILE_TESTS += devfreq_has_freq_table +NV_CONFTEST_FUNCTION_COMPILE_TESTS += devfreq_has_suspend_freq NV_CONFTEST_FUNCTION_COMPILE_TESTS += device_add_disk_has_int_return_type NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_pm_domain_attach_list NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_of_icc_get diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index ad5309e5..512b3818 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -6956,6 +6956,23 @@ compile_test() { compile_check_conftest "$CODE" "NV_DEVFREQ_HAS_FREQ_TABLE" "" "types" ;; + devfreq_has_suspend_freq) + # + # Determine if the 'devfreq' structure has 'suspend_freq' + # + # Commit 83f8ca45afbf ("PM / devfreq: add support for + # suspend/resume of a devfreq device") updated the devfreq + # and add the suspend_freq field in v5.0. + # + CODE=" + #include + int conftest_devfreq_has_suspend_freq(void) { + return offsetof(struct devfreq, suspend_freq); + } + " + compile_check_conftest "$CODE" "NV_DEVFREQ_HAS_SUSPEND_FREQ" "" "types" + ;; + device_add_disk_has_int_return_type) # # Determine if the function device_add_disk() returns an integer.