Lines Matching +full:audio +full:- +full:graph

1 // SPDX-License-Identifier: GPL-2.0-only
2 // SPDX-FileCopyrightText: Copyright (c) 2020-2025 NVIDIA CORPORATION. All rights reserved.
4 // tegra_audio_graph_card.c - Audio Graph based Tegra Machine Driver
12 #include <sound/soc-dai.h>
41 /* Tegra audio chip data */
50 !dai->driver->ops || in need_clk_update()
51 !dai->driver->name) in need_clk_update()
54 if (strstr(dai->driver->name, "I2S") || in need_clk_update()
55 strstr(dai->driver->name, "DMIC") || in need_clk_update()
56 strstr(dai->driver->name, "DSPK")) in need_clk_update()
67 struct simple_util_priv *simple = snd_soc_card_get_drvdata(rtd->card); in tegra_audio_graph_update_pll()
69 struct device *dev = rtd->card->dev; in tegra_audio_graph_update_pll()
81 plla_out0_rate = data->plla_out0_rates[x11_RATE]; in tegra_audio_graph_update_pll()
82 plla_rate = data->plla_rates[x11_RATE]; in tegra_audio_graph_update_pll()
90 plla_out0_rate = data->plla_out0_rates[x8_RATE]; in tegra_audio_graph_update_pll()
91 plla_rate = data->plla_rates[x8_RATE]; in tegra_audio_graph_update_pll()
94 dev_err(rtd->card->dev, "Unsupported sample rate %u\n", in tegra_audio_graph_update_pll()
96 return -EINVAL; in tegra_audio_graph_update_pll()
104 * |--> PLLA_OUT0 in tegra_audio_graph_update_pll()
106 * |---> I2S modules in tegra_audio_graph_update_pll()
108 * |---> DMIC modules in tegra_audio_graph_update_pll()
110 * |---> DSPK modules in tegra_audio_graph_update_pll()
115 * clock rates and glitchy audio. The maximum divider is 128 in tegra_audio_graph_update_pll()
126 dev_dbg(rtd->card->dev, in tegra_audio_graph_update_pll()
131 err = clk_set_rate(priv->clk_plla, plla_rate); in tegra_audio_graph_update_pll()
133 dev_err(rtd->card->dev, in tegra_audio_graph_update_pll()
140 err = clk_set_rate(priv->clk_plla_out0, plla_out0_rate); in tegra_audio_graph_update_pll()
142 dev_err(rtd->card->dev, in tegra_audio_graph_update_pll()
178 priv->clk_plla = devm_clk_get(card->dev, "pll_a"); in tegra_audio_graph_card_probe()
179 if (IS_ERR(priv->clk_plla)) { in tegra_audio_graph_card_probe()
180 dev_err(card->dev, "Can't retrieve clk pll_a\n"); in tegra_audio_graph_card_probe()
181 return PTR_ERR(priv->clk_plla); in tegra_audio_graph_card_probe()
184 priv->clk_plla_out0 = devm_clk_get(card->dev, "plla_out0"); in tegra_audio_graph_card_probe()
185 if (IS_ERR(priv->clk_plla_out0)) { in tegra_audio_graph_card_probe()
186 dev_err(card->dev, "Can't retrieve clk plla_out0\n"); in tegra_audio_graph_card_probe()
187 return PTR_ERR(priv->clk_plla_out0); in tegra_audio_graph_card_probe()
196 struct device *dev = &pdev->dev; in tegra_audio_graph_probe()
201 return -ENOMEM; in tegra_audio_graph_probe()
203 card = simple_priv_to_card(&priv->simple); in tegra_audio_graph_probe()
204 card->driver_name = "tegra-ape"; in tegra_audio_graph_probe()
206 card->probe = tegra_audio_graph_card_probe; in tegra_audio_graph_probe()
209 card->component_chaining = 1; in tegra_audio_graph_probe()
210 priv->simple.ops = &tegra_audio_graph_ops; in tegra_audio_graph_probe()
211 priv->simple.force_dpcm = 1; in tegra_audio_graph_probe()
213 return audio_graph_parse_of(&priv->simple, dev); in tegra_audio_graph_probe()
244 { .compatible = "nvidia,tegra210-audio-graph-card",
246 { .compatible = "nvidia,tegra186-audio-graph-card",
248 { .compatible = "nvidia,tegra264-audio-graph-card",
256 .name = "tegra-audio-graph-card",
266 MODULE_DESCRIPTION("ASoC Tegra Audio Graph Sound Card");