ASoC: tegra: Fix build for Linux v6.3

Upstream Linux commit ("3653480c6812 ASoC: soc-dai.h: cleanup
Playback/Capture data for snd_soc_dai") removes the capture_dma_data
and playback_dma_data variables from snd_soc_dai structure and this
breaks building the Tegra210 ADMAIF driver. Fix this by using the
appropriate API for Linux v6.3.

Bug 4014315

Change-Id: I76c8401571130a3d7ebaecacdfc299d59c1eaf8e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2867123
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2023-02-28 16:31:28 +00:00
committed by mobile promotions
parent a8830def61
commit 7f2c6fcd8c
2 changed files with 13 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
* Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*/
#include <linux/version.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/of_platform.h>
@@ -236,8 +237,13 @@ static struct snd_soc_dai_ops tegra210_admaif_dai_ops = {
static int tegra210_admaif_dai_probe(struct snd_soc_dai *dai)
{
#if (KERNEL_VERSION(6, 3, 0) <= LINUX_VERSION_CODE)
snd_soc_dai_init_dma_data(dai, &admaif->playback_dma_data[dai->id],
&admaif->capture_dma_data[dai->id]);
#else
dai->capture_dma_data = &admaif->capture_dma_data[dai->id];
dai->playback_dma_data = &admaif->playback_dma_data[dai->id];
#endif
return 0;
}

View File

@@ -2,8 +2,9 @@
//
// tegra210_admaif.c - Tegra ADMAIF driver
//
// Copyright (c) 2020-2022 NVIDIA CORPORATION. All rights reserved.
// Copyright (c) 2020-2023 NVIDIA CORPORATION. All rights reserved.
#include <linux/version.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/module.h>
@@ -791,9 +792,13 @@ static int tegra_admaif_dai_probe(struct snd_soc_dai *dai)
{
struct tegra_admaif *admaif = snd_soc_dai_get_drvdata(dai);
#if (KERNEL_VERSION(6, 3, 0) <= LINUX_VERSION_CODE)
snd_soc_dai_init_dma_data(dai, &admaif->playback_dma_data[dai->id],
&admaif->capture_dma_data[dai->id]);
#else
dai->capture_dma_data = &admaif->capture_dma_data[dai->id];
dai->playback_dma_data = &admaif->playback_dma_data[dai->id];
#endif
return 0;
}