mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
Revert "ASoC: tegra: use upstreamed AHUB drivers"
This reverts commit 363a679975.
This is done to unblock gvs intermittency of audio test and
kernel warning test failure.
Bug 4508166
Change-Id: I99e2b879c7ba1c7987d859b4ae9fce0ea317e41e
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3082636
Reviewed-by: Shubham Chandra <shubhamc@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Shubham Chandra <shubhamc@nvidia.com>
This commit is contained in:
committed by
Shubham Chandra
parent
00c10d965b
commit
1d0f4c4ffc
@@ -1,7 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
// SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION. All rights reserved.
|
||||
//
|
||||
// tegra_machine_driver.c - Tegra ASoC Machine driver
|
||||
/*
|
||||
* Copyright (c) 2017-2023 NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* Tegra ASoC Machine driver
|
||||
*/
|
||||
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
@@ -112,8 +114,7 @@ static int tegra_machine_codec_put_format(struct snd_kcontrol *kcontrol,
|
||||
|
||||
static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *runtime,
|
||||
unsigned int rate, unsigned int channels,
|
||||
u64 formats,
|
||||
struct snd_pcm_hw_params *pcm_params)
|
||||
u64 formats)
|
||||
{
|
||||
unsigned int mask = (1 << channels) - 1;
|
||||
struct snd_soc_card *card = runtime->card;
|
||||
@@ -166,22 +167,6 @@ static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *runtime,
|
||||
machine->audio_clock.set_pll_out, aud_mclk, srate);
|
||||
|
||||
list_for_each_entry(rtd, &card->rtd_list, list) {
|
||||
/* fixup PCM params */
|
||||
if (pcm_params && rtd->dai_link->be_hw_params_fixup) {
|
||||
struct snd_pcm_hw_params new_params = *pcm_params;
|
||||
|
||||
err = rtd->dai_link->be_hw_params_fixup(rtd, &new_params);
|
||||
if (err) {
|
||||
dev_err(rtd->card->dev, "fixup failed for link %s\n",
|
||||
rtd->dai_link->name);
|
||||
return err;
|
||||
}
|
||||
|
||||
srate = params_rate(&new_params);
|
||||
channels = params_channels(&new_params);
|
||||
format_k = 1 << params_format(&new_params);
|
||||
}
|
||||
|
||||
#if defined(NV_SND_SOC_DAI_LINK_STRUCT_HAS_C2C_PARAMS_ARG) /* Linux v6.4 */
|
||||
if (!rtd->dai_link->c2c_params)
|
||||
continue;
|
||||
@@ -223,8 +208,7 @@ static int tegra_machine_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||
|
||||
err = tegra_machine_dai_init(rtd, params_rate(params),
|
||||
params_channels(params),
|
||||
params_format(params),
|
||||
params);
|
||||
params_format(params));
|
||||
if (err < 0) {
|
||||
dev_err(card->dev, "Failed dai init\n");
|
||||
return err;
|
||||
@@ -291,8 +275,7 @@ static int tegra_machine_compr_set_params(struct snd_compr_stream *cstream)
|
||||
|
||||
err = tegra_machine_dai_init(rtd, codec_params.sample_rate,
|
||||
codec_params.ch_out,
|
||||
SNDRV_PCM_FORMAT_S16_LE,
|
||||
NULL);
|
||||
SNDRV_PCM_FORMAT_S16_LE);
|
||||
if (err < 0) {
|
||||
dev_err(card->dev, "Failed dai init\n");
|
||||
return err;
|
||||
@@ -344,46 +327,6 @@ static struct snd_soc_card snd_soc_tegra_card = {
|
||||
.driver_name = "tegra-ape",
|
||||
};
|
||||
|
||||
static struct snd_soc_dai_driver tegra_dummy_dai = {
|
||||
.name = "tegra-snd-dummy-dai",
|
||||
.playback = {
|
||||
.stream_name = "Dummy Playback",
|
||||
.channels_min = 1,
|
||||
.channels_max = 32,
|
||||
.rates = SNDRV_PCM_RATE_8000_192000,
|
||||
.formats = SNDRV_PCM_FMTBIT_S8 |
|
||||
SNDRV_PCM_FMTBIT_S16_LE |
|
||||
SNDRV_PCM_FMTBIT_S32_LE,
|
||||
},
|
||||
.capture = {
|
||||
.stream_name = "Dummy Capture",
|
||||
.channels_min = 1,
|
||||
.channels_max = 32,
|
||||
.rates = SNDRV_PCM_RATE_8000_192000,
|
||||
.formats = SNDRV_PCM_FMTBIT_S8 |
|
||||
SNDRV_PCM_FMTBIT_S16_LE |
|
||||
SNDRV_PCM_FMTBIT_S32_LE,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_widget tegra_dummy_widgets[] = {
|
||||
SND_SOC_DAPM_MIC("Dummy MIC", NULL),
|
||||
SND_SOC_DAPM_SPK("Dummy SPK", NULL),
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_route tegra_dummy_routes[] = {
|
||||
{"Dummy SPK", NULL, "Dummy Playback"},
|
||||
{"Dummy Capture", NULL, "Dummy MIC"},
|
||||
};
|
||||
|
||||
static const struct snd_soc_component_driver tegra_dummy_component = {
|
||||
.dapm_widgets = tegra_dummy_widgets,
|
||||
.num_dapm_widgets = ARRAY_SIZE(tegra_dummy_widgets),
|
||||
.dapm_routes = tegra_dummy_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(tegra_dummy_routes),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
/* structure to match device tree node */
|
||||
static const struct of_device_id tegra_machine_of_match[] = {
|
||||
{ .compatible = "nvidia,tegra186-ape" },
|
||||
@@ -417,13 +360,6 @@ static int tegra_machine_driver_probe(struct platform_device *pdev)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = devm_snd_soc_register_component(&pdev->dev, &tegra_dummy_component,
|
||||
&tegra_dummy_dai, 1);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "Tegra dummy component registration fails\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = add_dai_links(card);
|
||||
if (ret < 0)
|
||||
goto cleanup_asoc;
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
* later by storing all DAI settings in the driver.
|
||||
*/
|
||||
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of_platform.h>
|
||||
@@ -419,16 +417,8 @@ static int tegra_mixer_control_probe(struct platform_device *pdev)
|
||||
|
||||
/* Fixup callback for BE codec2codec links */
|
||||
for_each_card_rtds(card, rtd) {
|
||||
/* Skip FE links for sound card with DPCM routes for AHUB */
|
||||
if (rtd->card->component_chaining && !rtd->dai_link->no_pcm)
|
||||
continue;
|
||||
|
||||
/* Skip FE links for sound card with codec2codc routes for AHUB */
|
||||
#if defined(NV_SND_SOC_DAI_LINK_STRUCT_HAS_C2C_PARAMS_ARG) /* Linux v6.4 */
|
||||
if (!rtd->card->component_chaining && !rtd->dai_link->c2c_params)
|
||||
#else
|
||||
if (!rtd->card->component_chaining && !rtd->dai_link->params)
|
||||
#endif
|
||||
/* Skip FE links */
|
||||
if (!rtd->dai_link->no_pcm)
|
||||
continue;
|
||||
|
||||
rtd->dai_link->be_hw_params_fixup = tegra_hw_params_fixup;
|
||||
|
||||
Reference in New Issue
Block a user