sound: Use conftest to find if snd_soc_dai_ops has probe callback

Use conftest to find if struct snd_soc_dai_ops have the probe()
callback or not. In Linux 6.5, commit 516ee7009ff20 ("ASoC:
tegra: merge DAI call back functions into ops") added probe()
callback into the struct snd_soc_dai_ops.

Bug 4346767

Change-Id: If292f10d6e52a2cf80c7700ff7aba5805041531f
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028743
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-12-05 18:31:40 +00:00
committed by mobile promotions
parent bf46060d1e
commit 350a86106e
5 changed files with 26 additions and 8 deletions

View File

@@ -134,6 +134,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += shrinker_alloc
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_card_jack_new_has_no_snd_soc_jack_pins
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_component_driver_struct_has_non_legacy_dai_naming
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_dai_link_struct_has_c2c_params_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_dai_ops_struct_has_probe
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_of_get_dai_name_has_index_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_rtd_to_codec
NV_CONFTEST_FUNCTION_COMPILE_TESTS += simple_util_dai_init

View File

@@ -7181,6 +7181,23 @@ compile_test() {
"NV_SND_SOC_DAI_LINK_STRUCT_HAS_C2C_PARAMS_ARG" "" "types"
;;
snd_soc_dai_ops_struct_has_probe)
#
# Determine if 'struct snd_soc_dai_ops' has the 'probe' member.
#
# In Linux v6.5, commits 516ee7009ff20 ("ASoC: tegra: merge DAI
# call back functions into ops") added probe() callback into the
# struct snd_soc_dai_ops.
#
CODE="
#include <sound/soc.h>
int conftest_snd_soc_dai_ops_struct_has_probe(void) {
return offsetof(struct snd_soc_dai_ops, probe);
}"
compile_check_conftest "$CODE" "NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_PRESENT" "" "types"
;;
snd_soc_of_get_dai_name_has_index_arg)
#
# Determine if the function 'snd_soc_of_get_dai_name()' has an index argument.