sound: soc: Avoid uses of asoc_xxx()

From Linux 6.7, the asoc_xxx() is replaced by the various
function. Use the appropriate functions.

***
commit 1d5a2b5dd0a8d2b2b535b5266699429dbd48e62f
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

    ASoC: soc.h: convert asoc_xxx() to snd_soc_xxx()

Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

    ASoC: simple_card_utils.h: convert not to use asoc_xxx()

***

Bug 4346767

Change-Id: Ie3945f3997d745df8223fd31c1386a3db44e6ceb
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3019997
(cherry picked from commit 36d1775879)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3036787
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-11-21 08:24:49 +00:00
committed by mobile promotions
parent 7f9beef481
commit 4ab98ef641
5 changed files with 57 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ LINUX_VERSION := $(shell expr $(VERSION) \* 256 + $(PATCHLEVEL))
LINUX_VERSION_6_2 := $(shell expr 6 \* 256 + 2) LINUX_VERSION_6_2 := $(shell expr 6 \* 256 + 2)
LINUX_VERSION_6_3 := $(shell expr 6 \* 256 + 3) LINUX_VERSION_6_3 := $(shell expr 6 \* 256 + 3)
LINUX_VERSION_6_6 := $(shell expr 6 \* 256 + 6) LINUX_VERSION_6_6 := $(shell expr 6 \* 256 + 6)
LINUX_VERSION_6_7 := $(shell expr 6 \* 256 + 7)
# The Tegra IVC driver was updated to support iosys-map in Linux v6.2. # The Tegra IVC driver was updated to support iosys-map in Linux v6.2.
# For Linux v6.2 kernels, don't build any drivers that requires this. # For Linux v6.2 kernels, don't build any drivers that requires this.
@@ -52,6 +53,11 @@ subdir-ccflags-y += -DNV_V4L2_ASYNC_NF_SUBDEVICE_INIT_RENAME
export CONFIG_SKIP_CRYPTO=y export CONFIG_SKIP_CRYPTO=y
endif 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
endif
ifeq ($(CONFIG_TEGRA_VIRTUALIZATION),y) ifeq ($(CONFIG_TEGRA_VIRTUALIZATION),y)
subdir-ccflags-y += -DCONFIG_TEGRA_VIRTUALIZATION subdir-ccflags-y += -DCONFIG_TEGRA_VIRTUALIZATION
endif endif

View File

@@ -37,13 +37,21 @@ 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)
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); struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
#endif
int ret; int ret;
if (rtd->dai_link->no_pcm) if (rtd->dai_link->no_pcm)
return 0; return 0;
#if defined(NV_ASOC_XXX_DROP)
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); dmap = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
#endif
/* Set HW params now that initialization is complete */ /* Set HW params now that initialization is complete */
snd_soc_set_runtime_hwparams(substream, &tegra_alt_pcm_hardware); snd_soc_set_runtime_hwparams(substream, &tegra_alt_pcm_hardware);
@@ -106,7 +114,11 @@ 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)
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); dmap = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
#endif
if (!dmap) if (!dmap)
return 0; return 0;
@@ -249,8 +261,13 @@ 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)
dmap = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0),
pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream);
#else
dmap = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), dmap = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0),
pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream); pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream);
#endif
if (dmap->buffer_size > size) if (dmap->buffer_size > size)
buffer_size = dmap->buffer_size; buffer_size = dmap->buffer_size;
if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
@@ -261,8 +278,13 @@ static int tegra_alt_pcm_dma_allocate(struct snd_soc_pcm_runtime *rtd,
goto err; goto err;
} }
#if defined(NV_ASOC_XXX_DROP)
dmap = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0),
pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream);
#else
dmap = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), dmap = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0),
pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream); pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream);
#endif
if (dmap->buffer_size > size) if (dmap->buffer_size > size)
buffer_size = dmap->buffer_size; buffer_size = dmap->buffer_size;
if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {

View File

@@ -203,9 +203,14 @@ 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)
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
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
struct snd_soc_dai_driver *codec_drv = codec_dai->driver;
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
#endif
struct snd_soc_dai_driver *codec_drv = codec_dai->driver;
struct snd_soc_dai_driver *cpu_drv = cpu_dai->driver; struct snd_soc_dai_driver *cpu_drv = cpu_dai->driver;
cpu_drv->playback.rates = SNDRV_PCM_RATE_KNOT; cpu_drv->playback.rates = SNDRV_PCM_RATE_KNOT;

View File

@@ -498,18 +498,32 @@ static int parse_dt_dai_links(struct snd_soc_card *card,
if (of_property_read_string(link_node, if (of_property_read_string(link_node,
"link-name", "link-name",
&dai_link->name)) { &dai_link->name)) {
#if defined(NV_ASOC_XXX_DROP)
ret = simple_util_set_dailink_name(
&pdev->dev, dai_link, "%s-%d",
"tegra-dlink", link_count);
#else
ret = asoc_simple_set_dailink_name( ret = asoc_simple_set_dailink_name(
&pdev->dev, dai_link, "%s-%d", &pdev->dev, dai_link, "%s-%d",
"tegra-dlink", link_count); "tegra-dlink", link_count);
#endif
if (ret < 0) if (ret < 0)
goto cleanup; goto cleanup;
} }
#if defined(NV_ASOC_XXX_DROP)
simple_util_parse_daifmt(&pdev->dev, link_node, codec,
NULL, &dai_link->dai_fmt);
simple_util_canonicalize_platform(dai_link->platforms,
dai_link->cpus);
#else
asoc_simple_parse_daifmt(&pdev->dev, link_node, codec, asoc_simple_parse_daifmt(&pdev->dev, link_node, codec,
NULL, &dai_link->dai_fmt); NULL, &dai_link->dai_fmt);
asoc_simple_canonicalize_platform(dai_link->platforms, asoc_simple_canonicalize_platform(dai_link->platforms,
dai_link->cpus); dai_link->cpus);
#endif
of_property_read_u32(link_node, "link-type", of_property_read_u32(link_node, "link-type",
&link_type); &link_type);
@@ -582,7 +596,11 @@ int parse_card_info(struct snd_soc_card *card, struct snd_soc_ops *pcm_ops,
struct device_node *node = card->dev->of_node; struct device_node *node = card->dev->of_node;
int ret; int ret;
#if defined(NV_ASOC_XXX_DROP)
ret = simple_util_parse_card_name(card, PREFIX);
#else
ret = asoc_simple_parse_card_name(card, PREFIX); ret = asoc_simple_parse_card_name(card, PREFIX);
#endif
if (ret < 0) if (ret < 0)
return ret; return ret;

View File

@@ -22,8 +22,13 @@
static int tegra_audio_dai_init(struct snd_soc_pcm_runtime *rtd) static int tegra_audio_dai_init(struct snd_soc_pcm_runtime *rtd)
{ {
/* Used for audio graph based sound cards only */ /* Used for audio graph based sound cards only */
#if defined(NV_ASOC_XXX_DROP)
if (rtd->card->component_chaining)
return simple_util_dai_init(rtd);
#else
if (rtd->card->component_chaining) if (rtd->card->component_chaining)
return asoc_simple_dai_init(rtd); return asoc_simple_dai_init(rtd);
#endif
return 0; return 0;
} }