conftest: update tests for devfreq and thermal

Introduce the following three tests:
1. devfreq_dev_profile_has_is_cooling_device
2. devfreq_has_freq_table
3. thermal_zone_for_each_trip

Bug 4854967

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I5fe2f7102f667a31d61550487a153590584ed638
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3213844
(cherry picked from commit ae9d7ea9479637e77732bc1842a5488653157d21)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3221294
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
This commit is contained in:
Johnny Liu
2024-09-18 01:30:55 +00:00
committed by mobile promotions
parent c580fd0d06
commit 93b1b8542e
2 changed files with 53 additions and 0 deletions

View File

@@ -6763,6 +6763,39 @@ compile_test() {
compile_check_conftest "$CODE" "NV_DEFINE_SEMAPHORE_HAS_NUMBER_ARG" "" "types"
;;
devfreq_dev_profile_has_is_cooling_device)
#
# Determine if the 'devfreq_dev_profile' structure has 'is_cooling_device'.
#
# Commit 1224451bb6f93 ("PM / devfreq: Register devfreq as a cooling device
# on demand") updated the devfreq_dev_profile and add the is_cooling_device
# field in v5.12.
#
CODE="
#include <linux/devfreq.h>
bool conftest_devfreq_dev_profile_has_is_cooling_device(struct devfreq_dev_profile *profile) {
return profile->is_cooling_device;
}"
compile_check_conftest "$CODE" "NV_DEVFREQ_DEV_PROFILE_HAS_IS_COOLING_DEVICE" "" "types"
;;
devfreq_has_freq_table)
#
# Determine if the 'devfreq' structure has 'freq_table'.
#
# Commit b5d281f6c16d ("PM / devfreq: Rework freq_table to be local to devfreq
# struct") updated the devfreq and add the freq_table field in v5.19.
#
CODE="
#include <linux/devfreq.h>
unsigned long *conftest_devfreq_has_freq_table(struct devfreq *devfreq) {
return devfreq->freq_table;
}"
compile_check_conftest "$CODE" "NV_DEVFREQ_HAS_FREQ_TABLE" "" "types"
;;
device_add_disk_has_int_return_type)
#
# Determine if the function device_add_disk() returns an integer.
@@ -7917,6 +7950,23 @@ compile_test() {
compile_check_conftest "$CODE" "NV_THERMAL_ZONE_DEVICE_PRIV_PRESENT" "" "functions"
;;
thermal_zone_for_each_trip)
#
# Determine if the function thermal_zone_for_each_trip is present.
#
# thermal_zone_for_each_trip was added in commit a56cc0a833852
# ("thermal: core: Add function to walk trips under zone lock")
# in v6.6-rc3 (2023-10-03)
#
CODE="
#include <linux/thermal.h>
int conftest_thermal_zone_for_each_trip(void) {
return thermal_zone_for_each_trip();
}"
compile_check_conftest "$CODE" "NV_THERMAL_ZONE_FOR_EACH_TRIP_PRESENT" "" "functions"
;;
tegra_dev_iommu_get_stream_id)
#
# Determine if the function tegra_dev_iommu_get_stream_id is present.