mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
sound: Use conftest to find if snd_soc_xxx() present
In Linux 6.7, with change
commit 1d5a2b5dd0a8d2b2 ("ASoC: soc.h: convert asoc_xxx() to snd_soc_xxx()")
asoc_xxx() calls are replaced by snd_soc_xxx() calls.
Use conftest to findout this change.
Bug 4346767
Change-Id: I8cd5ac5a5befa83c139dbf8f6253840a97c1d4be
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028577
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
ed5ae591c9
commit
e225408ff7
@@ -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_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_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_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 += tc_taprio_qopt_offload_struct_has_cmd
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_dev_iommu_get_stream_id
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_dev_iommu_get_stream_id
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_ivc_struct_has_iosys_map
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_ivc_struct_has_iosys_map
|
||||||
|
|||||||
@@ -7133,6 +7133,22 @@ compile_test() {
|
|||||||
compile_check_conftest "$CODE" "NV_SND_SOC_OF_GET_DAI_NAME_HAS_INDEX_ARG" "" "types"
|
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 <sound/soc.h>
|
||||||
|
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)
|
tc_taprio_qopt_offload_struct_has_cmd)
|
||||||
#
|
#
|
||||||
# Determine if struct tc_taprio_qopt_offload has a member named cmd
|
# Determine if struct tc_taprio_qopt_offload has a member named cmd
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
* Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
* Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/dma-mapping.h>
|
#include <linux/dma-mapping.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
@@ -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 snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||||
struct tegra_alt_pcm_dma_params *dmap;
|
struct tegra_alt_pcm_dma_params *dmap;
|
||||||
struct dma_chan *chan;
|
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);
|
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||||
#else
|
#else
|
||||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
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)
|
if (rtd->dai_link->no_pcm)
|
||||||
return 0;
|
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);
|
dmap = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||||
#else
|
#else
|
||||||
dmap = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
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)
|
if (rtd->dai_link->no_pcm)
|
||||||
return 0;
|
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);
|
dmap = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||||
#else
|
#else
|
||||||
dmap = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
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)
|
if (ret)
|
||||||
return 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),
|
dmap = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0),
|
||||||
pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream);
|
pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream);
|
||||||
#else
|
#else
|
||||||
@@ -278,7 +280,7 @@ static int tegra_alt_pcm_dma_allocate(struct snd_soc_pcm_runtime *rtd,
|
|||||||
goto err;
|
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),
|
dmap = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0),
|
||||||
pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream);
|
pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ static int tegra_virt_machine_driver_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
list_for_each_entry(rtd, &card->rtd_list, list) {
|
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 *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user