From be22100ee2af4edb0ca2c73d5bd37ae625ed34cb Mon Sep 17 00:00:00 2001 From: Mohan Kumar Date: Thu, 3 Oct 2019 09:13:22 +0530 Subject: [PATCH] ASoC: tegra-alt: Fix machine driver ASRC config was enabled for all chip versions and this leads to writing in the dai_links array for T210 platforms which is not acceptable as there was no ASRC present on it. Fix this issue by having extra runtime compatible check for t210. Bug 200555164 Change-Id: I3714d4aed77b6cecc262db443219920f872c3e17 Signed-off-by: Mohan Kumar Reviewed-on: https://git-master.nvidia.com/r/2210518 (cherry picked from commit f9598cb45db19454a77fd78f680cc2b8db50cc7b) Reviewed-on: https://git-master.nvidia.com/r/2210938 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Sameer Pujar Reviewed-by: Ravindra Lokhande Reviewed-by: mobile promotions Tested-by: mobile promotions --- .../tegra_machine_driver_mobile.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c index 04a0a92a..34962d50 100644 --- a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c +++ b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c @@ -679,15 +679,18 @@ static void set_dai_ops(struct tegra_machine *machine) &tegra_machine_compr_ops; #endif #if IS_ENABLED(CONFIG_SND_SOC_TEGRA186_ASRC_ALT) - /* set ASRC params. The default is 2 channels */ - for (i = 0; i < 6; i++) { - int tx = TEGRA186_DAI_LINK_ASRC1_TX1 + i; - int rx = TEGRA186_DAI_LINK_ASRC1_RX1 + i; + if (!(of_machine_is_compatible("nvidia,tegra210") || + of_machine_is_compatible("nvidia,tegra210b01"))) { + /* set ASRC params. The default is 2 channels */ + for (i = 0; i < 6; i++) { + int tx = TEGRA186_DAI_LINK_ASRC1_TX1 + i; + int rx = TEGRA186_DAI_LINK_ASRC1_RX1 + i; - machine->asoc->dai_links[tx].params = - &tegra_machine_asrc_link_params[i]; - machine->asoc->dai_links[rx].params = - &tegra_machine_asrc_link_params[i]; + machine->asoc->dai_links[tx].params = + &tegra_machine_asrc_link_params[i]; + machine->asoc->dai_links[rx].params = + &tegra_machine_asrc_link_params[i]; + } } #endif }