diff --git a/Makefile b/Makefile index 44fa8b05..c109adaa 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ subdir-ccflags-y += -Werror LINUX_VERSION := $(shell expr $(VERSION) \* 256 + $(PATCHLEVEL)) LINUX_VERSION_6_2 := $(shell expr 6 \* 256 + 2) 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. # 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 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) subdir-ccflags-y += -DCONFIG_TEGRA_VIRTUALIZATION endif diff --git a/sound/soc/tegra-virt-alt/tegra210_virt_alt_admaif.c b/sound/soc/tegra-virt-alt/tegra210_virt_alt_admaif.c index 489654ca..47f93fb9 100644 --- a/sound/soc/tegra-virt-alt/tegra210_virt_alt_admaif.c +++ b/sound/soc/tegra-virt-alt/tegra210_virt_alt_admaif.c @@ -228,12 +228,6 @@ static int tegra210_admaif_startup(struct snd_pcm_substream *substream, 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) { 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; } +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) \ { \ .name = "ADMAIF" #id, \ @@ -268,6 +298,8 @@ static int tegra210_admaif_dai_probe(struct snd_soc_dai *dai) }, \ .ops = &tegra210_admaif_dai_ops, \ } +#endif + static struct snd_soc_dai_driver tegra210_admaif_dais[] = { ADMAIF_DAI(1), diff --git a/sound/soc/tegra/tegra210_admaif.c b/sound/soc/tegra/tegra210_admaif.c index 9d6421f8..e99bad1f 100644 --- a/sound/soc/tegra/tegra210_admaif.c +++ b/sound/soc/tegra/tegra210_admaif.c @@ -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) { 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; } +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) \ { \ .name = dai_name, \ @@ -823,6 +853,8 @@ static int tegra_admaif_dai_probe(struct snd_soc_dai *dai) }, \ .ops = &tegra_admaif_dai_ops, \ } +#endif + #define ADMAIF_CODEC_FIFO_DAI(id) \ { \