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
(cherry picked from commit e225408ff7)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3036789
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-12-05 12:59:54 +00:00
committed by mobile promotions
parent 1432eb248d
commit 29ab9b19c9
2 changed files with 8 additions and 6 deletions

View File

@@ -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

View File

@@ -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