ASoC: tegra: Fix build errors with kstable

Build errors seen in following contexts with kstable:

  - The 'non_legacy_dai_naming' flag is not available in struct
    'snd_soc_component_driver' in v6.0. Instead it is replaced
    with flag 'legacy_dai_naming' and default value works fine.
    To fix build error on kstable exclude the removed flag for
    kernel v6.0 onward.

  - Signature of snd_soc_card_jack_new() has changed in v5.19
    which drops struct 'snd_soc_jack_pins' related members. These
    were unused for Tegra and is safe to just update the funcion
    call. Fix this by using correct function signature based on
    kernel version checks.

With above fixed now, remove workaround from Makefile and enable
Audio OOT driver builds again with kstable.

Bug 3831575

Change-Id: I7b65c89e8140f6e085528fb827d47c3909233db1
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2793430
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Sameer Pujar
2022-10-17 17:48:34 +00:00
committed by mobile promotions
parent 6799b30ec7
commit 47b127bd17
15 changed files with 51 additions and 2 deletions

View File

@@ -2,6 +2,4 @@
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
obj-m += drivers/ obj-m += drivers/
ifeq ($(shell test $$VERSION -lt 6; echo $$?),0)
obj-m += sound/soc/tegra/ obj-m += sound/soc/tegra/
endif

View File

@@ -17,6 +17,7 @@
#ifdef CONFIG_TEGRA186_AHC #ifdef CONFIG_TEGRA186_AHC
#include <linux/tegra186_ahc.h> #include <linux/tegra186_ahc.h>
#endif #endif
#include <linux/version.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
@@ -535,7 +536,9 @@ static struct snd_soc_component_driver tegra186_arad_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra186_arad_routes), .num_dapm_routes = ARRAY_SIZE(tegra186_arad_routes),
.controls = tegra186_arad_controls, .controls = tegra186_arad_controls,
.num_controls = ARRAY_SIZE(tegra186_arad_controls), .num_controls = ARRAY_SIZE(tegra186_arad_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static bool tegra186_arad_wr_reg(struct device *dev, unsigned int reg) static bool tegra186_arad_wr_reg(struct device *dev, unsigned int reg)

View File

@@ -17,6 +17,7 @@
#ifdef CONFIG_TEGRA186_AHC #ifdef CONFIG_TEGRA186_AHC
#include <linux/tegra186_ahc.h> #include <linux/tegra186_ahc.h>
#endif #endif
#include <linux/version.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
@@ -874,7 +875,9 @@ static struct snd_soc_component_driver tegra186_asrc_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra186_asrc_routes), .num_dapm_routes = ARRAY_SIZE(tegra186_asrc_routes),
.controls = tegra186_asrc_controls, .controls = tegra186_asrc_controls,
.num_controls = ARRAY_SIZE(tegra186_asrc_controls), .num_controls = ARRAY_SIZE(tegra186_asrc_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static bool tegra186_asrc_wr_reg(struct device *dev, unsigned int reg) static bool tegra186_asrc_wr_reg(struct device *dev, unsigned int reg)

View File

@@ -12,6 +12,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc.h> #include <sound/soc.h>
@@ -598,7 +599,9 @@ static const struct snd_soc_component_driver tegra186_dspk_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra186_dspk_routes), .num_dapm_routes = ARRAY_SIZE(tegra186_dspk_routes),
.controls = tegrat186_dspk_controls, .controls = tegrat186_dspk_controls,
.num_controls = ARRAY_SIZE(tegrat186_dspk_controls), .num_controls = ARRAY_SIZE(tegrat186_dspk_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static bool tegra186_dspk_wr_reg(struct device *dev, unsigned int reg) static bool tegra186_dspk_wr_reg(struct device *dev, unsigned int reg)

View File

@@ -13,6 +13,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
@@ -632,7 +633,9 @@ static struct snd_soc_component_driver tegra210_adx_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_adx_routes), .num_dapm_routes = ARRAY_SIZE(tegra210_adx_routes),
.controls = tegra210_adx_controls, .controls = tegra210_adx_controls,
.num_controls = ARRAY_SIZE(tegra210_adx_controls), .num_controls = ARRAY_SIZE(tegra210_adx_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static bool tegra210_adx_wr_reg(struct device *dev, static bool tegra210_adx_wr_reg(struct device *dev,

View File

@@ -13,6 +13,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
@@ -395,7 +396,9 @@ static const struct snd_soc_component_driver tegra210_afc_cmpnt = {
.num_dapm_widgets = ARRAY_SIZE(tegra210_afc_widgets), .num_dapm_widgets = ARRAY_SIZE(tegra210_afc_widgets),
.dapm_routes = tegra210_afc_routes, .dapm_routes = tegra210_afc_routes,
.num_dapm_routes = ARRAY_SIZE(tegra210_afc_routes), .num_dapm_routes = ARRAY_SIZE(tegra210_afc_routes),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static const struct snd_soc_component_driver tegra186_afc_cmpnt = { static const struct snd_soc_component_driver tegra186_afc_cmpnt = {
@@ -405,7 +408,9 @@ static const struct snd_soc_component_driver tegra186_afc_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_afc_routes), .num_dapm_routes = ARRAY_SIZE(tegra210_afc_routes),
.controls = tegra186_afc_controls, .controls = tegra186_afc_controls,
.num_controls = ARRAY_SIZE(tegra186_afc_controls), .num_controls = ARRAY_SIZE(tegra186_afc_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static bool tegra210_afc_wr_rd_reg(struct device *dev, unsigned int reg) static bool tegra210_afc_wr_rd_reg(struct device *dev, unsigned int reg)

View File

@@ -11,6 +11,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/version.h>
#include <sound/soc.h> #include <sound/soc.h>
#include "tegra210_ahub.h" #include "tegra210_ahub.h"
@@ -1411,7 +1412,9 @@ static const struct snd_soc_component_driver tegra210_ahub_component = {
.num_dapm_widgets = ARRAY_SIZE(tegra210_ahub_widgets), .num_dapm_widgets = ARRAY_SIZE(tegra210_ahub_widgets),
.dapm_routes = tegra210_ahub_routes, .dapm_routes = tegra210_ahub_routes,
.num_dapm_routes = ARRAY_SIZE(tegra210_ahub_routes), .num_dapm_routes = ARRAY_SIZE(tegra210_ahub_routes),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static const struct snd_soc_component_driver tegra186_ahub_component = { static const struct snd_soc_component_driver tegra186_ahub_component = {
@@ -1419,7 +1422,9 @@ static const struct snd_soc_component_driver tegra186_ahub_component = {
.num_dapm_widgets = ARRAY_SIZE(tegra186_ahub_widgets), .num_dapm_widgets = ARRAY_SIZE(tegra186_ahub_widgets),
.dapm_routes = tegra186_ahub_routes, .dapm_routes = tegra186_ahub_routes,
.num_dapm_routes = ARRAY_SIZE(tegra186_ahub_routes), .num_dapm_routes = ARRAY_SIZE(tegra186_ahub_routes),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static const struct snd_soc_component_driver tegra234_ahub_component = { static const struct snd_soc_component_driver tegra234_ahub_component = {
@@ -1427,7 +1432,9 @@ static const struct snd_soc_component_driver tegra234_ahub_component = {
.num_dapm_widgets = ARRAY_SIZE(tegra234_ahub_widgets), .num_dapm_widgets = ARRAY_SIZE(tegra234_ahub_widgets),
.dapm_routes = tegra186_ahub_routes, .dapm_routes = tegra186_ahub_routes,
.num_dapm_routes = ARRAY_SIZE(tegra186_ahub_routes), .num_dapm_routes = ARRAY_SIZE(tegra186_ahub_routes),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static const struct regmap_config tegra210_ahub_regmap_config = { static const struct regmap_config tegra210_ahub_regmap_config = {

View File

@@ -13,6 +13,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
@@ -671,7 +672,9 @@ static struct snd_soc_component_driver tegra210_amx_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_amx_routes), .num_dapm_routes = ARRAY_SIZE(tegra210_amx_routes),
.controls = tegra210_amx_controls, .controls = tegra210_amx_controls,
.num_controls = ARRAY_SIZE(tegra210_amx_controls), .num_controls = ARRAY_SIZE(tegra210_amx_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static bool tegra210_amx_wr_reg(struct device *dev, static bool tegra210_amx_wr_reg(struct device *dev,

View File

@@ -12,6 +12,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc.h> #include <sound/soc.h>
@@ -565,7 +566,9 @@ static const struct snd_soc_component_driver tegra210_dmic_compnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_dmic_routes), .num_dapm_routes = ARRAY_SIZE(tegra210_dmic_routes),
.controls = tegra210_dmic_controls, .controls = tegra210_dmic_controls,
.num_controls = ARRAY_SIZE(tegra210_dmic_controls), .num_controls = ARRAY_SIZE(tegra210_dmic_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static bool tegra210_dmic_wr_reg(struct device *dev, unsigned int reg) static bool tegra210_dmic_wr_reg(struct device *dev, unsigned int reg)

View File

@@ -11,6 +11,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc.h> #include <sound/soc.h>
@@ -1126,7 +1127,9 @@ static const struct snd_soc_component_driver tegra210_i2s_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_i2s_routes), .num_dapm_routes = ARRAY_SIZE(tegra210_i2s_routes),
.controls = tegra210_i2s_controls, .controls = tegra210_i2s_controls,
.num_controls = ARRAY_SIZE(tegra210_i2s_controls), .num_controls = ARRAY_SIZE(tegra210_i2s_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static bool tegra210_i2s_wr_reg(struct device *dev, unsigned int reg) static bool tegra210_i2s_wr_reg(struct device *dev, unsigned int reg)

View File

@@ -13,6 +13,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
@@ -515,7 +516,9 @@ static struct snd_soc_component_driver tegra210_mixer_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_mixer_routes), .num_dapm_routes = ARRAY_SIZE(tegra210_mixer_routes),
.controls = tegra210_mixer_gain_ctls, .controls = tegra210_mixer_gain_ctls,
.num_controls = ARRAY_SIZE(tegra210_mixer_gain_ctls), .num_controls = ARRAY_SIZE(tegra210_mixer_gain_ctls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static bool tegra210_mixer_wr_reg(struct device *dev, static bool tegra210_mixer_wr_reg(struct device *dev,

View File

@@ -13,6 +13,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
@@ -619,7 +620,9 @@ static struct snd_soc_component_driver tegra210_mvc_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_mvc_routes), .num_dapm_routes = ARRAY_SIZE(tegra210_mvc_routes),
.controls = tegra210_mvc_vol_ctrl, .controls = tegra210_mvc_vol_ctrl,
.num_controls = ARRAY_SIZE(tegra210_mvc_vol_ctrl), .num_controls = ARRAY_SIZE(tegra210_mvc_vol_ctrl),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static bool tegra210_mvc_rd_reg(struct device *dev, unsigned int reg) static bool tegra210_mvc_rd_reg(struct device *dev, unsigned int reg)

View File

@@ -13,6 +13,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
@@ -208,7 +209,9 @@ static struct snd_soc_component_driver tegra210_ope_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_ope_routes), .num_dapm_routes = ARRAY_SIZE(tegra210_ope_routes),
.controls = tegra210_ope_controls, .controls = tegra210_ope_controls,
.num_controls = ARRAY_SIZE(tegra210_ope_controls), .num_controls = ARRAY_SIZE(tegra210_ope_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static bool tegra210_ope_wr_reg(struct device *dev, unsigned int reg) static bool tegra210_ope_wr_reg(struct device *dev, unsigned int reg)

View File

@@ -13,6 +13,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/version.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
@@ -3366,7 +3367,9 @@ static struct snd_soc_component_driver tegra210_sfc_cmpnt = {
.num_dapm_routes = ARRAY_SIZE(tegra210_sfc_routes), .num_dapm_routes = ARRAY_SIZE(tegra210_sfc_routes),
.controls = tegra210_sfc_controls, .controls = tegra210_sfc_controls,
.num_controls = ARRAY_SIZE(tegra210_sfc_controls), .num_controls = ARRAY_SIZE(tegra210_sfc_controls),
#if (KERNEL_VERSION(6, 0, 0) > LINUX_VERSION_CODE)
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
#endif
}; };
static bool tegra210_sfc_wr_reg(struct device *dev, unsigned int reg) static bool tegra210_sfc_wr_reg(struct device *dev, unsigned int reg)

View File

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