ASoC: tegra: Align with upstream DT for compatible and clock name

It is nice to have downstream DTB working well with upstream kernel
drivers. This gives a flexibile option for users to choose between
out-of-tree and upstream audio drivers by selectively adding either
of these to deny list.

For clock PLLA_OUT0, upstream DT uses 'plla_out0' clock name where
as downstream uses 'pll_a_out0'. So aligning with upstream DT makes
probe to fail. Thus update the clock name in driver to match upstream
DT bindings.

The sound DT supports compatibles to either work with upstream or
downstream machine drivers. Earlier the source 'tegra_codecs.c' was
modified to make it potentially usable for upstream machine driver
as well and thus it has upstream compatible checks. This check is
now replaced with a flag which is known to be set only during
upstream machine driver probe.

Bug 4119612

Change-Id: Icd5d97343029e35a5702ff4dc527881fb9277346
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2948525
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Sameer Pujar
2023-08-03 18:02:44 +00:00
committed by mobile promotions
parent 5fe0f39e06
commit 1e35fdd8c5
2 changed files with 5 additions and 8 deletions

View File

@@ -3,7 +3,7 @@
* tegra_asoc_utils.c - Harmony machine ASoC driver
*
* Author: Stephen Warren <swarren@nvidia.com>
* Copyright (c) 2010-2022 NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2010-2023 NVIDIA CORPORATION. All rights reserved.
*/
#include <linux/clk.h>
@@ -364,9 +364,9 @@ int tegra_asoc_utils_init(struct tegra_asoc_utils_data *data,
return PTR_ERR(data->clk_pll_a);
}
data->clk_pll_a_out0 = devm_clk_get(dev, "pll_a_out0");
data->clk_pll_a_out0 = devm_clk_get(dev, "plla_out0");
if (IS_ERR(data->clk_pll_a_out0)) {
dev_err(data->dev, "Can't retrieve clk pll_a_out0\n");
dev_err(data->dev, "Can't retrieve clk plla_out0\n");
return PTR_ERR(data->clk_pll_a_out0);
}

View File

@@ -2,7 +2,7 @@
//
// tegra_codecs.c - External audio codec setup
//
// Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
// Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved.
#include <dt-bindings/sound/tas2552.h>
#include <linux/input.h>
@@ -20,11 +20,8 @@
static int tegra_audio_dai_init(struct snd_soc_pcm_runtime *rtd)
{
struct device_node *node = rtd->card->dev->of_node;
/* Used for audio graph based sound cards only */
if (of_device_is_compatible(node, "nvidia,tegra186-audio-graph-card") ||
of_device_is_compatible(node, "nvidia,tegra210-audio-graph-card"))
if (rtd->card->component_chaining)
return asoc_simple_dai_init(rtd);
return 0;