ASoC: tegra: Avoid kernel version checks

Rather than using kernel version checks to determine which kernel APIs
to use, add the necessary tests to the conftest script to determine
which kernel APIs are present in the kernel.

Note that the function snd_soc_dai_init_dma_data() has been present
in the Linux kernel since v3.13 and so use this for all kernel versions.
In Linux v6.3, the 'playback_dma_data' and 'capture_dma_data' members of
the snd_soc_dai_driver structure were replaced and so these could no
longer be set directly. However, the arguments to
snd_soc_dai_init_dma_data() have not changed and so can be used for
older kernels and well has the current.

This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.

Bug 4221847

Change-Id: Ibac0c6bab78e93f03981dfe3d1b2025ea19d4c92
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993795
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-07 19:39:51 +01:00
committed by mobile promotions
parent 5ec164e7c3
commit 59b14ea0b8
19 changed files with 111 additions and 47 deletions

View File

@@ -101,6 +101,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += define_semaphore_has_number_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += device_add_disk_has_int_return_type
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_thermal_of_zone_register
NV_CONFTEST_FUNCTION_COMPILE_TESTS += disk_check_media_change
NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_slave_config_struct_has_slave_id
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_aperture_remove_framebuffers
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_driver_struct_has_irq_enabled_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fb_helper_alloc_info
@@ -119,6 +120,8 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_set_tso_max_size
NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pde_data
NV_CONFTEST_FUNCTION_COMPILE_TESTS += register_shrinker_has_fmt_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_card_jack_new_has_no_snd_soc_jack_pins
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_component_driver_struct_has_non_legacy_dai_naming
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_dai_link_struct_has_c2c_params_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_of_get_dai_name_has_index_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tc_taprio_qopt_offload_struct_has_cmd

View File

@@ -6566,6 +6566,23 @@ compile_test() {
compile_check_conftest "$CODE" "NV_DISK_CHECK_MEDIA_CHANGE_PRESENT" "" "functions"
;;
dma_slave_config_struct_has_slave_id)
#
# Determine if 'struct dma_slave_config' has the 'slave_id' member.
#
# In Linux v5.17, commit 3c2196440757 ("dmaengine: remove slave_id config field")
# removed the 'slave_id' member from the 'struct dma_slave_config'.
#
CODE="
#include <linux/dma-engine.h>
int conftest_dma_slave_config_struct_has_slave_id(void) {
return offsetof(struct dma_slave_config, slave_id);
}"
compile_check_conftest "$CODE" \
"NV_DMA_SLAVE_CONFIG_STRUCT_HAS_SLAVE_ID" "" "types"
;;
drm_aperture_remove_framebuffers)
#
# Determine if the function 'drm_aperture_remove_framebuffers'
@@ -6916,6 +6933,47 @@ compile_test() {
compile_check_conftest "$CODE" "NV_REQUEST_STRUCT_HAS_COMPLETION_DATA_ARG" "" "types"
;;
snd_soc_card_jack_new_has_no_snd_soc_jack_pins)
#
# Determine if the function snd_soc_card_jack_new() has 'pins' and
# 'num_pins' arguments.
#
# In Linux v5,19, commit 19aed2d6cdb7 ("ASoC: soc-card: Create jack
# kcontrol without pins") removed the 'pins' and 'num_pins'
# arguments from the snd_soc_card_jack_new() function.
#
CODE="
#include <sound/jack.h>
#include <sound/soc.h>
int conftest_snd_soc_card_jack_new_has_no_snd_soc_jack_pins(struct snd_soc_card *card,
struct snd_soc_jack *jack) {
return snd_soc_card_jack_new(card, \"Jack\", SND_JACK_HEADSET, jack);
}"
compile_check_conftest "$CODE" \
"NV_SND_SOC_CARD_JACK_NEW_HAS_NO_SND_SOC_JACK_PINS" "" "types"
;;
snd_soc_component_driver_struct_has_non_legacy_dai_naming)
#
# Determine if 'struct snd_soc_component_driver' has the
# 'non_legacy_dai_naming' member.
#
# In Linux v6.0, commit 01936221278c ("ASoC: soc-component: Remove
# non_legacy_dai_naming flag") removed the 'non_legacy_dai_naming'
# flag from the 'struct snd_soc_component_driver'.
#
CODE="
#include <sound/soc-component.h>
unsigned int conftest_snd_soc_component_driver_struct_has_non_legacy_dai_naming(
struct snd_soc_component_driver *driver) {
return driver->non_legacy_dai_naming;
}"
compile_check_conftest "$CODE" \
"NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING" "" "types"
;;
snd_soc_dai_link_struct_has_c2c_params_arg)
#
# Determine if 'struct snd_soc_dai_link' has the 'c2c_params' member.

View File

@@ -3,7 +3,6 @@
* 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>
@@ -237,13 +236,8 @@ 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

@@ -4,6 +4,8 @@
//
// Copyright (c) 2015-2023, NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
@@ -17,7 +19,6 @@
#ifdef CONFIG_TEGRA186_AHC
#include <linux/tegra186_ahc.h>
#endif
#include <linux/version.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -536,7 +537,7 @@ static struct snd_soc_component_driver tegra186_arad_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra186_arad_routes),
.controls = tegra186_arad_controls,
.num_controls = ARRAY_SIZE(tegra186_arad_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2015-2023, NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
@@ -17,7 +19,6 @@
#ifdef CONFIG_TEGRA186_AHC
#include <linux/tegra186_ahc.h>
#endif
#include <linux/version.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -875,7 +876,7 @@ static struct snd_soc_component_driver tegra186_asrc_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra186_asrc_routes),
.controls = tegra186_asrc_controls,
.num_controls = ARRAY_SIZE(tegra186_asrc_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2020-2023 NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/module.h>
@@ -12,7 +14,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
@@ -564,7 +565,7 @@ static const struct snd_soc_component_driver tegra186_dspk_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra186_dspk_routes),
.controls = tegrat186_dspk_controls,
.num_controls = ARRAY_SIZE(tegrat186_dspk_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -4,7 +4,6 @@
//
// 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>
@@ -792,13 +791,9 @@ 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;
}

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2014-2023 NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
@@ -13,7 +15,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -633,7 +634,7 @@ static struct snd_soc_component_driver tegra210_adx_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_adx_routes),
.controls = tegra210_adx_controls,
.num_controls = ARRAY_SIZE(tegra210_adx_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2014-2023 NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
@@ -13,7 +15,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -396,7 +397,7 @@ static const struct snd_soc_component_driver tegra210_afc_cmpnt = {
.num_dapm_widgets = ARRAY_SIZE(tegra210_afc_widgets),
.dapm_routes = tegra210_afc_routes,
.num_dapm_routes = ARRAY_SIZE(tegra210_afc_routes),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};
@@ -408,7 +409,7 @@ static const struct snd_soc_component_driver tegra186_afc_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_afc_routes),
.controls = tegra186_afc_controls,
.num_controls = ARRAY_SIZE(tegra186_afc_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2020-2023 NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/module.h>
@@ -11,7 +13,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/version.h>
#include <sound/soc.h>
#include "tegra210_ahub.h"
@@ -1496,7 +1497,7 @@ static const struct snd_soc_component_driver tegra210_ahub_component = {
.num_dapm_widgets = ARRAY_SIZE(tegra210_ahub_widgets),
.dapm_routes = tegra210_ahub_routes,
.num_dapm_routes = ARRAY_SIZE(tegra210_ahub_routes),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};
@@ -1506,7 +1507,7 @@ static const struct snd_soc_component_driver tegra186_ahub_component = {
.num_dapm_widgets = ARRAY_SIZE(tegra186_ahub_widgets),
.dapm_routes = tegra186_ahub_routes,
.num_dapm_routes = ARRAY_SIZE(tegra186_ahub_routes),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};
@@ -1516,7 +1517,7 @@ static const struct snd_soc_component_driver tegra234_ahub_component = {
.num_dapm_widgets = ARRAY_SIZE(tegra234_ahub_widgets),
.dapm_routes = tegra186_ahub_routes,
.num_dapm_routes = ARRAY_SIZE(tegra186_ahub_routes),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2014-2023 NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
@@ -672,7 +674,7 @@ static struct snd_soc_component_driver tegra210_amx_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_amx_routes),
.controls = tegra210_amx_controls,
.num_controls = ARRAY_SIZE(tegra210_amx_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2020-2023 NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/math64.h>
@@ -12,7 +14,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
@@ -566,7 +567,7 @@ static const struct snd_soc_component_driver tegra210_dmic_compnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_dmic_routes),
.controls = tegra210_dmic_controls,
.num_controls = ARRAY_SIZE(tegra210_dmic_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2020-2023 NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/module.h>
@@ -11,7 +13,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
@@ -1127,7 +1128,7 @@ static const struct snd_soc_component_driver tegra210_i2s_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_i2s_routes),
.controls = tegra210_i2s_controls,
.num_controls = ARRAY_SIZE(tegra210_i2s_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2014-2023 NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
@@ -13,7 +15,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -516,7 +517,7 @@ static struct snd_soc_component_driver tegra210_mixer_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_mixer_routes),
.controls = tegra210_mixer_gain_ctls,
.num_controls = ARRAY_SIZE(tegra210_mixer_gain_ctls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2014-2023 NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
@@ -13,7 +15,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -620,7 +621,7 @@ static struct snd_soc_component_driver tegra210_mvc_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_mvc_routes),
.controls = tegra210_mvc_vol_ctrl,
.num_controls = ARRAY_SIZE(tegra210_mvc_vol_ctrl),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2014-2023, NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
@@ -13,7 +15,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -209,7 +210,7 @@ static struct snd_soc_component_driver tegra210_ope_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_ope_routes),
.controls = tegra210_ope_controls,
.num_controls = ARRAY_SIZE(tegra210_ope_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -4,6 +4,8 @@
//
// Copyright (c) 2014-2023 NVIDIA CORPORATION. All rights reserved.
#include <nvidia/conftest.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
@@ -13,7 +15,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -3367,7 +3368,7 @@ static struct snd_soc_component_driver tegra210_sfc_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_sfc_routes),
.controls = tegra210_sfc_controls,
.num_controls = ARRAY_SIZE(tegra210_sfc_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
#if defined(NV_SND_SOC_COMPONENT_DRIVER_STRUCT_HAS_NON_LEGACY_DAI_NAMING) /* Linux v6.0 */
.non_legacy_dai_naming = 1,
#endif
};

View File

@@ -8,7 +8,6 @@
#include <dt-bindings/sound/tas2552.h>
#include <linux/input.h>
#include <linux/version.h>
#include <sound/jack.h>
#include <sound/soc.h>
#include <sound/simple_card_utils.h>
@@ -44,12 +43,12 @@ static int tegra_machine_rt56xx_init(struct snd_soc_pcm_runtime *rtd)
if (!jack)
return -ENOMEM;
#if (KERNEL_VERSION(5, 19, 0) > LINUX_VERSION_CODE)
err = snd_soc_card_jack_new(card, "Headset Jack", SND_JACK_HEADSET,
jack, NULL, 0);
#else
#if defined(NV_SND_SOC_CARD_JACK_NEW_HAS_NO_SND_SOC_JACK_PINS) /* Linux v5.19 */
err = snd_soc_card_jack_new(card, "Headset Jack", SND_JACK_HEADSET,
jack);
#else
err = snd_soc_card_jack_new(card, "Headset Jack", SND_JACK_HEADSET,
jack, NULL, 0);
#endif
if (err) {
dev_err(card->dev, "Headset Jack creation failed %d\n", err);

View File

@@ -5,6 +5,8 @@
#define pr_fmt(msg) "Safety I2S: " msg
#include <nvidia/conftest.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/dmaengine_pcm.h>
@@ -13,7 +15,6 @@
#include <linux/dmaengine.h>
#include <linux/clk.h>
#include <linux/reset.h>
#include <linux/version.h>
#include "tegra_i2s.h"
@@ -456,7 +457,7 @@ static int gpcdma_hw_params(struct snd_pcm_substream *substream,
slave_config.src_maxburst = 2;
}
#if (KERNEL_VERSION(5, 17, 0) > LINUX_VERSION_CODE)
#if defined(NV_DMA_SLAVE_CONFIG_STRUCT_HAS_SLAVE_ID) /* Linux v5.17 */
//TODO: Read from DT later on
slave_config.slave_id = dma_data->req_sel;
#endif