sound: soc: Add support to build with Linux 6.6

Moving the probe of DAI inside the ops based on change
done as follows:
----
commit 516ee7009ff20eb3f73a64a1fe2ffe10997696e6
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Tue Aug 8 22:56:58 2023 +0000

    ASoC: tegra: merge DAI call back functions into ops

    ALSA SoC merges DAI call backs into .ops.
    This patch merge these into one.

    Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Link: https://lore.kernel.org/r/874jl9b0sl.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
-----

Change-Id: I2b4b8604a37cffbe9e1cc6af85f3443780d227ab
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3007245
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-10-31 09:05:33 +00:00
committed by mobile promotions
parent 4403c71b96
commit 007b4eb4ae
3 changed files with 85 additions and 13 deletions

View File

@@ -9,6 +9,7 @@ subdir-ccflags-y += -Werror
LINUX_VERSION := $(shell expr $(VERSION) \* 256 + $(PATCHLEVEL)) 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)
# 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.
@@ -25,6 +26,13 @@ ifeq ($(shell test $(LINUX_VERSION) -ge $(LINUX_VERSION_6_3); echo $$?),0)
export CONFIG_TEGRA_GPIO_LEGACY_DISABLE=y export CONFIG_TEGRA_GPIO_LEGACY_DISABLE=y
endif endif
# Changes done in Linux 6.6 onwards
ifeq ($(shell test $(LINUX_VERSION) -ge $(LINUX_VERSION_6_6); echo $$?),0)
# Move probe to DAI Ops.
export CONFIG_SND_SOC_MOVE_DAI_PROBE_TO_OPS=y
subdir-ccflags-y += -DNV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_ARG
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

@@ -228,12 +228,6 @@ static int tegra210_admaif_startup(struct snd_pcm_substream *substream,
SNDRV_PCM_HW_PARAM_RATE, &tegra210_rate_constraints); SNDRV_PCM_HW_PARAM_RATE, &tegra210_rate_constraints);
} }
static struct snd_soc_dai_ops tegra210_admaif_dai_ops = {
.hw_params = tegra210_admaif_hw_params,
.trigger = tegra210_admaif_trigger,
.startup = tegra210_admaif_startup,
};
static int tegra210_admaif_dai_probe(struct snd_soc_dai *dai) static int tegra210_admaif_dai_probe(struct snd_soc_dai *dai)
{ {
snd_soc_dai_init_dma_data(dai, &admaif->playback_dma_data[dai->id], snd_soc_dai_init_dma_data(dai, &admaif->playback_dma_data[dai->id],
@@ -242,6 +236,42 @@ static int tegra210_admaif_dai_probe(struct snd_soc_dai *dai)
return 0; return 0;
} }
static struct snd_soc_dai_ops tegra210_admaif_dai_ops = {
#if defined(NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_ARG)
.probe = tegra210_admaif_dai_probe,
#endif
.hw_params = tegra210_admaif_hw_params,
.trigger = tegra210_admaif_trigger,
.startup = tegra210_admaif_startup,
};
#if defined(NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_ARG)
#define ADMAIF_DAI(id) \
{ \
.name = "ADMAIF" #id, \
.playback = { \
.stream_name = "Playback " #id, \
.channels_min = 1, \
.channels_max = 16, \
.rates = SNDRV_PCM_RATE_8000_192000, \
.formats = SNDRV_PCM_FMTBIT_S8 | \
SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE, \
}, \
.capture = { \
.stream_name = "Capture " #id, \
.channels_min = 1, \
.channels_max = 16, \
.rates = SNDRV_PCM_RATE_8000_192000, \
.formats = SNDRV_PCM_FMTBIT_S8 | \
SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE, \
}, \
.ops = &tegra210_admaif_dai_ops, \
}
#else
#define ADMAIF_DAI(id) \ #define ADMAIF_DAI(id) \
{ \ { \
.name = "ADMAIF" #id, \ .name = "ADMAIF" #id, \
@@ -268,6 +298,8 @@ static int tegra210_admaif_dai_probe(struct snd_soc_dai *dai)
}, \ }, \
.ops = &tegra210_admaif_dai_ops, \ .ops = &tegra210_admaif_dai_ops, \
} }
#endif
static struct snd_soc_dai_driver tegra210_admaif_dais[] = { static struct snd_soc_dai_driver tegra210_admaif_dais[] = {
ADMAIF_DAI(1), ADMAIF_DAI(1),

View File

@@ -447,13 +447,6 @@ static int tegra_admaif_trigger(struct snd_pcm_substream *substream, int cmd,
} }
} }
static const struct snd_soc_dai_ops tegra_admaif_dai_ops = {
.hw_params = tegra_admaif_hw_params,
.trigger = tegra_admaif_trigger,
.shutdown = tegra_admaif_shutdown,
.prepare = tegra_admaif_prepare,
};
static void tegra_admaif_reg_dump(struct device *dev) static void tegra_admaif_reg_dump(struct device *dev)
{ {
struct tegra_admaif *admaif = dev_get_drvdata(dev); struct tegra_admaif *admaif = dev_get_drvdata(dev);
@@ -797,6 +790,43 @@ static int tegra_admaif_dai_probe(struct snd_soc_dai *dai)
return 0; return 0;
} }
static const struct snd_soc_dai_ops tegra_admaif_dai_ops = {
#if defined(NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_ARG)
.probe = tegra_admaif_dai_probe,
#endif
.hw_params = tegra_admaif_hw_params,
.trigger = tegra_admaif_trigger,
.shutdown = tegra_admaif_shutdown,
.prepare = tegra_admaif_prepare,
};
#if defined(NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_ARG)
#define DAI(dai_name) \
{ \
.name = dai_name, \
.playback = { \
.stream_name = dai_name " Playback", \
.channels_min = 1, \
.channels_max = 16, \
.rates = SNDRV_PCM_RATE_KNOT, \
.formats = SNDRV_PCM_FMTBIT_S8 | \
SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE, \
}, \
.capture = { \
.stream_name = dai_name " Capture", \
.channels_min = 1, \
.channels_max = 16, \
.rates = SNDRV_PCM_RATE_KNOT, \
.formats = SNDRV_PCM_FMTBIT_S8 | \
SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE, \
}, \
.ops = &tegra_admaif_dai_ops, \
}
#else
#define DAI(dai_name) \ #define DAI(dai_name) \
{ \ { \
.name = dai_name, \ .name = dai_name, \
@@ -823,6 +853,8 @@ static int tegra_admaif_dai_probe(struct snd_soc_dai *dai)
}, \ }, \
.ops = &tegra_admaif_dai_ops, \ .ops = &tegra_admaif_dai_ops, \
} }
#endif
#define ADMAIF_CODEC_FIFO_DAI(id) \ #define ADMAIF_CODEC_FIFO_DAI(id) \
{ \ { \