From 3013b107c12432ee82b7a7e8c52b3c3da2b8d2cf Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Tue, 5 Dec 2023 13:35:41 +0000 Subject: [PATCH] sound: soc: Use conftest to find if asoc_simple_xxx renamed In Linux v6.7, commit b5a95c5bf6d69 ("ASoC: simple_card_utils.h: convert not to use asoc_xxx()") add new APIs to convert asoc_simple_xxx() to simple_util_xxx(). Use the conftest to find if soc_snd_util_xxx() present. Bug 4346767 Change-Id: I3b282eb08d51c997760cc0b9752438c94e3caae5 Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028578 Tested-by: mobile promotions Reviewed-by: mobile promotions --- Makefile | 2 -- scripts/conftest/Makefile | 1 + scripts/conftest/conftest.sh | 19 +++++++++++++++++++ sound/soc/tegra/tegra_asoc_machine.c | 6 +++--- sound/soc/tegra/tegra_codecs.c | 2 +- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 6b7265d6..2f77c1c7 100644 --- a/Makefile +++ b/Makefile @@ -76,8 +76,6 @@ endif # Changes done in Linux 6.7 onwards ifeq ($(shell test $(LINUX_VERSION) -ge $(LINUX_VERSION_6_7); echo $$?),0) -subdir-ccflags-y += -DNV_ASOC_XXX_DROP - # drm_debugfs_remove_files has root argument subdir-ccflags-y += -DNV_DRM_DEBUGFS_REMOVE_HAS_ROOT_ARGS endif diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index e2d2df80..35d21f82 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -132,6 +132,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_component_driver_struct_has_non_le NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_dai_link_struct_has_c2c_params_arg 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 NV_CONFTEST_FUNCTION_COMPILE_TESTS += tc_taprio_qopt_offload_struct_has_cmd NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_dev_iommu_get_stream_id NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_ivc_struct_has_iosys_map diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index b9efc5ba..b05c2b79 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -7149,6 +7149,25 @@ compile_test() { compile_check_conftest "$CODE" "NV_SND_SOC_RTD_TO_CODEC_PRESENT" "" "functions" ;; + simple_util_dai_init) + # + # Determine if the simple_util_dai_init() is present. This will help on finding + # if asoc_simple_xxx() renamed to simple_util_xxx() + # + # In Linux v6.7, commit b5a95c5bf6d69 ("ASoC: simple_card_utils.h: convert + # not to use asoc_xxx()") add new APIs to convert asoc_simple_xxx() to + # simple_util_xxx(). + # + CODE=" + #include + #include + void conftest_simple_util_dai_init(void) { + simple_util_dai_init(); + }" + + compile_check_conftest "$CODE" "NV_ASOC_SIMPLE_RENAMED_SIMPLE" "" "functions" + ;; + tc_taprio_qopt_offload_struct_has_cmd) # # Determine if struct tc_taprio_qopt_offload has a member named cmd diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c index 2d4a468c..8dbd1573 100644 --- a/sound/soc/tegra/tegra_asoc_machine.c +++ b/sound/soc/tegra/tegra_asoc_machine.c @@ -498,7 +498,7 @@ static int parse_dt_dai_links(struct snd_soc_card *card, if (of_property_read_string(link_node, "link-name", &dai_link->name)) { -#if defined(NV_ASOC_XXX_DROP) +#if defined(NV_ASOC_SIMPLE_RENAMED_SIMPLE) /* Linux 6.7 */ ret = simple_util_set_dailink_name( &pdev->dev, dai_link, "%s-%d", "tegra-dlink", link_count); @@ -511,7 +511,7 @@ static int parse_dt_dai_links(struct snd_soc_card *card, goto cleanup; } -#if defined(NV_ASOC_XXX_DROP) +#if defined(NV_ASOC_SIMPLE_RENAMED_SIMPLE) /* Linux 6.7 */ simple_util_parse_daifmt(&pdev->dev, link_node, codec, NULL, &dai_link->dai_fmt); @@ -596,7 +596,7 @@ int parse_card_info(struct snd_soc_card *card, struct snd_soc_ops *pcm_ops, struct device_node *node = card->dev->of_node; int ret; -#if defined(NV_ASOC_XXX_DROP) +#if defined(NV_ASOC_SIMPLE_RENAMED_SIMPLE) /* Linux 6.7 */ ret = simple_util_parse_card_name(card, PREFIX); #else ret = asoc_simple_parse_card_name(card, PREFIX); diff --git a/sound/soc/tegra/tegra_codecs.c b/sound/soc/tegra/tegra_codecs.c index cce49984..e16ec7d8 100644 --- a/sound/soc/tegra/tegra_codecs.c +++ b/sound/soc/tegra/tegra_codecs.c @@ -22,7 +22,7 @@ static int tegra_audio_dai_init(struct snd_soc_pcm_runtime *rtd) { /* Used for audio graph based sound cards only */ -#if defined(NV_ASOC_XXX_DROP) +#if defined(NV_ASOC_SIMPLE_RENAMED_SIMPLE) /* Linux 6.7 */ if (rtd->card->component_chaining) return simple_util_dai_init(rtd); #else