ASoC: tegra: Fix build for Linux v6.4

In Linux v6.4, the 'params' member of the snd_soc_dai_link was replaced
with the 'c2c_params' member. Add a new test to the conftest script that
checks if the 'c2c_params' structure member is present and use the
definition created by conftest to select which structure member is used.

Bug 4221847

Change-Id: I7ebb4187fd1cd70097bf65409bda3b2a6830a303
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989731
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2023-10-02 13:13:02 +01:00
committed by mobile promotions
parent d021a4fbae
commit 2cc58560db
7 changed files with 255 additions and 4 deletions

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <dt-bindings/sound/tas2552.h>
#include <linux/input.h>
#include <linux/version.h>
@@ -137,7 +139,11 @@ static int set_pll_sysclk(struct device *dev, struct snd_soc_pcm_runtime *rtd,
unsigned int bclk_rate;
int err;
#if defined(NV_SND_SOC_DAI_LINK_STRUCT_HAS_C2C_PARAMS_ARG) /* Linux v6.4 */
dai_params = (struct snd_soc_pcm_stream *)rtd->dai_link->c2c_params;
#else
dai_params = (struct snd_soc_pcm_stream *)rtd->dai_link->params;
#endif
switch (dai_params->formats) {
case SNDRV_PCM_FMTBIT_S8: