ASoC: tegra: Fix build for Linux v6.4

In Linux v6.4, the 'params' member of the snd_soc_dai_link was replaced
with the 'c2c_params' member. Add a new test to the conftest script that
checks if the 'c2c_params' structure member is present and use the
definition created by conftest to select which structure member is used.

Bug 4221847

Change-Id: I7ebb4187fd1cd70097bf65409bda3b2a6830a303
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989731
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2023-10-02 13:13:02 +01:00
committed by mobile promotions
parent d021a4fbae
commit 2cc58560db
7 changed files with 255 additions and 4 deletions

View File

@@ -6684,6 +6684,24 @@ compile_test() {
compile_check_conftest "$CODE" "NV_REGISTER_SHRINKER_HAS_FMT_ARG" "" "types"
;;
snd_soc_dai_link_struct_has_c2c_params_arg)
#
# Determine if 'struct snd_soc_dai_link' has the 'c2c_params' member.
#
# In Linux v6.4, commits 7ddc7f91beb2 ("ASoC: soc.h: clarify Codec2Codec params")
# and 1ea63f29c277 ("ASoC: soc.h: remove unused params/num_params") replaced the
# 'params' member of the snd_soc_dai_link with the 'c2c_params' member.
#
CODE="
#include <sound/soc.h>
int conftest_snd_soc_dai_link_struct_has_c2c_params_args(void) {
return offsetof(struct snd_soc_dai_link, c2c_params);
}"
compile_check_conftest "$CODE" \
"NV_SND_SOC_DAI_LINK_STRUCT_HAS_C2C_PARAMS_ARG" "" "types"
;;
tegra_ivc_struct_has_iosys_map)
#
# Determine if the 'tegra_ivc' structure has the 'map' argument.