diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 5f10e5d1..e2d2df80 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -131,6 +131,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_card_jack_new_has_no_snd_soc_jack_ 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_of_get_dai_name_has_index_arg +NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_rtd_to_codec 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 fd11da65..b9efc5ba 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -7133,6 +7133,22 @@ compile_test() { compile_check_conftest "$CODE" "NV_SND_SOC_OF_GET_DAI_NAME_HAS_INDEX_ARG" "" "types" ;; + snd_soc_rtd_to_codec) + # + # Determine if the snd_soc_rtd_to_codec() present or not + # + # In Linux v6.7, commit 1d5a2b5dd0a8d2 ("ASoC: soc.h: convert asoc_xxx() + # to snd_soc_xxx()") to replace all asoc_xxx() to snd_soc_xxx(). + # + CODE=" + #include + void conftest_snd_soc_rtd_to_codec(void) { + snd_soc_rtd_to_codec(); + }" + + compile_check_conftest "$CODE" "NV_SND_SOC_RTD_TO_CODEC_PRESENT" "" "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-virt-alt/tegra_pcm_virt_alt.c b/sound/soc/tegra-virt-alt/tegra_pcm_virt_alt.c index 70ec4401..b057e401 100644 --- a/sound/soc/tegra-virt-alt/tegra_pcm_virt_alt.c +++ b/sound/soc/tegra-virt-alt/tegra_pcm_virt_alt.c @@ -3,6 +3,8 @@ * Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ +#include + #include #include #include @@ -37,7 +39,7 @@ static int tegra_alt_pcm_open(struct snd_soc_component *component, struct snd_soc_pcm_runtime *rtd = substream->private_data; struct tegra_alt_pcm_dma_params *dmap; struct dma_chan *chan; -#if defined(NV_ASOC_XXX_DROP) +#if defined(NV_SND_SOC_RTD_TO_CODEC_PRESENT) /* Linux 6.7*/ struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); #else struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); @@ -47,7 +49,7 @@ static int tegra_alt_pcm_open(struct snd_soc_component *component, if (rtd->dai_link->no_pcm) return 0; -#if defined(NV_ASOC_XXX_DROP) +#if defined(NV_SND_SOC_RTD_TO_CODEC_PRESENT) /* Linux 6.7*/ dmap = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream); #else dmap = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream); @@ -114,7 +116,7 @@ static int tegra_alt_pcm_hw_params(struct snd_soc_component *component, if (rtd->dai_link->no_pcm) return 0; -#if defined(NV_ASOC_XXX_DROP) +#if defined(NV_SND_SOC_RTD_TO_CODEC_PRESENT) /* Linux 6.7*/ dmap = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream); #else dmap = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream); @@ -261,7 +263,7 @@ static int tegra_alt_pcm_dma_allocate(struct snd_soc_pcm_runtime *rtd, if (ret) return ret; -#if defined(NV_ASOC_XXX_DROP) +#if defined(NV_SND_SOC_RTD_TO_CODEC_PRESENT) /* Linux 6.7*/ dmap = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream); #else @@ -278,7 +280,7 @@ static int tegra_alt_pcm_dma_allocate(struct snd_soc_pcm_runtime *rtd, goto err; } -#if defined(NV_ASOC_XXX_DROP) +#if defined(NV_SND_SOC_RTD_TO_CODEC_PRESENT) /* Linux 6.7*/ dmap = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream); #else diff --git a/sound/soc/tegra-virt-alt/tegra_virt_ref_alt.c b/sound/soc/tegra-virt-alt/tegra_virt_ref_alt.c index 94873866..aeeb19b9 100644 --- a/sound/soc/tegra-virt-alt/tegra_virt_ref_alt.c +++ b/sound/soc/tegra-virt-alt/tegra_virt_ref_alt.c @@ -203,7 +203,7 @@ static int tegra_virt_machine_driver_probe(struct platform_device *pdev) } list_for_each_entry(rtd, &card->rtd_list, list) { -#if defined(NV_ASOC_XXX_DROP) +#if defined(NV_SND_SOC_RTD_TO_CODEC_PRESENT) /* Linux 6.7*/ struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); #else