sound: Use conftest to find if snd_soc_dai_ops has probe callback

Use conftest to find if struct snd_soc_dai_ops have the probe()
callback or not. In Linux 6.5, commit 516ee7009ff20 ("ASoC:
tegra: merge DAI call back functions into ops") added probe()
callback into the struct snd_soc_dai_ops.

Bug 4346767

Change-Id: If292f10d6e52a2cf80c7700ff7aba5805041531f
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028743
(cherry picked from commit 350a86106e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053701
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-12-05 18:31:40 +00:00
committed by mobile promotions
parent 0d940461d4
commit 3a35e1c2b1
5 changed files with 29 additions and 11 deletions

View File

@@ -1,8 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*/
#include <nvidia/conftest.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/of_platform.h>
@@ -237,7 +239,7 @@ static int tegra210_admaif_dai_probe(struct snd_soc_dai *dai)
}
static struct snd_soc_dai_ops tegra210_admaif_dai_ops = {
#if defined(NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_ARG)
#if defined(NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_PRESENT) /* Linux 6.5 */
.probe = tegra210_admaif_dai_probe,
#endif
.hw_params = tegra210_admaif_hw_params,
@@ -245,7 +247,7 @@ static struct snd_soc_dai_ops tegra210_admaif_dai_ops = {
.startup = tegra210_admaif_startup,
};
#if defined(NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_ARG)
#if defined(NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_PRESENT) /* Linux 6.5 */
#define ADMAIF_DAI(id) \
{ \
.name = "ADMAIF" #id, \

View File

@@ -2,7 +2,9 @@
//
// tegra210_admaif.c - Tegra ADMAIF driver
//
// Copyright (c) 2020-2023 NVIDIA CORPORATION. All rights reserved.
// Copyright (c) 2020-2024 NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/device.h>
@@ -791,7 +793,7 @@ static int tegra_admaif_dai_probe(struct snd_soc_dai *dai)
}
static const struct snd_soc_dai_ops tegra_admaif_dai_ops = {
#if defined(NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_ARG)
#if defined(NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_PRESENT) /* Linux 6.5 */
.probe = tegra_admaif_dai_probe,
#endif
.hw_params = tegra_admaif_hw_params,
@@ -800,7 +802,7 @@ static const struct snd_soc_dai_ops tegra_admaif_dai_ops = {
.prepare = tegra_admaif_prepare,
};
#if defined(NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_ARG)
#if defined(NV_SND_SOC_DAI_OPS_STRUCT_HAS_PROBE_PRESENT) /* Linux 6.5 */
#define DAI(dai_name) \
{ \
.name = dai_name, \