[PATCH 00/10] Audio graph card updates and usage with Tegra210 audio
This series proposes following enhancements to audio-graph card driver. * Support multiple instances of a component. * Support Codec port with multiple endpoints. * Support open platforms with empty Codec endpoint. * Identify no-pcm DPCM DAI links which can be used in BE<->BE connections. * Add new compatible to support DPCM based DAI chaining.
This pushes DT support for Tegra210 based platforms which uses audio-graph card and above enhancements.
The series is based on following references where DPCM usgae for Tegra Audio and simple-card driver proposal were discussed. * https://lkml.org/lkml/2020/4/30/519 (DPCM for Tegra) * https://lkml.org/lkml/2020/6/27/4 (simple-card driver)
Sameer Pujar (10): ASoC: soc-core: Fix component name_prefix parsing ASoC: audio-graph: Use of_node and DAI for DPCM DAI link names ASoC: audio-graph: Support Codec with multiple endpoints ASoC: audio-graph: Support for empty end point ASoC: audio-graph: Identify 'no_pcm' DAI links for DPCM ASoC: soc-pcm: Get all BEs along DAPM path ASoC: dt-bindings: audio-graph-card: Support for component chaining ASoC: audio-graph: Add support for component chaining arm64: tegra: Audio graph header for Tegra210 arm64: tegra: Audio graph sound card for Jetson Nano and TX1
.../devicetree/bindings/sound/audio-graph-card.txt | 1 + .../boot/dts/nvidia/tegra210-audio-graph.dtsi | 120 +++++++++++++ arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 196 +++++++++++++++++++++ arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 110 ++++++++++++ include/sound/soc.h | 1 + sound/soc/generic/audio-graph-card.c | 85 ++++++--- sound/soc/soc-core.c | 3 +- sound/soc/soc-pcm.c | 3 +- 8 files changed, 495 insertions(+), 24 deletions(-) create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-audio-graph.dtsi
The "prefix" can be defined in DAI link node or it can be specified as part of the component node itself. Currently "sound-name-prefix" defined in a component is not taking effect. Actually the property is not getting parsed. It can be fixed by parsing "sound-name-prefix" property whenever "prefix" is missing in DAI link Codec node.
Signed-off-by: Sameer Pujar spujar@nvidia.com --- sound/soc/soc-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 7c58e45..a4efcbe 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1110,7 +1110,8 @@ static void soc_set_name_prefix(struct snd_soc_card *card, for (i = 0; i < card->num_configs; i++) { struct snd_soc_codec_conf *map = &card->codec_conf[i];
- if (snd_soc_is_matching_component(&map->dlc, component)) { + if (snd_soc_is_matching_component(&map->dlc, component) && + map->name_prefix) { component->name_prefix = map->name_prefix; return; }
For multiple instances of components, using DAI name alone for DAI links is causing conflicts. Components can define multiple DAIs and hence using just a device name won't help either. Thus DT device node reference and DAI names are used to uniquely represent DAI link names.
Signed-off-by: Sameer Pujar spujar@nvidia.com --- sound/soc/generic/audio-graph-card.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 97b4f54..1e20562 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -253,7 +253,8 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, goto out_put_node;
ret = asoc_simple_set_dailink_name(dev, dai_link, - "fe.%s", + "fe.%pOFP.%s", + cpus->of_node, cpus->dai_name); if (ret < 0) goto out_put_node; @@ -287,7 +288,8 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, goto out_put_node;
ret = asoc_simple_set_dailink_name(dev, dai_link, - "be.%s", + "be.%pOFP.%s", + codecs->of_node, codecs->dai_name); if (ret < 0) goto out_put_node;
If a Codec port has multiple endpoints, only first endpoint gets parsed and remaining are ignored. This can be fixed by removing 'dup_codec' flag passed to graph_dai_link_of_dpcm() and thus it loops over all endpoints of Codec. Similarly graph_count_dpcm() is updated as well.
Signed-off-by: Sameer Pujar spujar@nvidia.com --- sound/soc/generic/audio-graph-card.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-)
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 1e20562..b1903f9 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -201,8 +201,7 @@ static void graph_parse_mclk_fs(struct device_node *top, static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, struct device_node *cpu_ep, struct device_node *codec_ep, - struct link_info *li, - int dup_codec) + struct link_info *li) { struct device *dev = simple_priv_to_dev(priv); struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); @@ -217,10 +216,6 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, struct snd_soc_dai_link_component *codecs = dai_link->codecs; int ret;
- /* Do it all CPU endpoint, and 1st Codec endpoint */ - if (!li->cpu && dup_codec) - return 0; - port = of_get_parent(ep); ports = of_get_parent(port); node = of_graph_get_port_parent(ep); @@ -415,7 +410,7 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, int (*func_dpcm)(struct asoc_simple_priv *priv, struct device_node *cpu_ep, struct device_node *codec_ep, - struct link_info *li, int dup_codec)) + struct link_info *li)) { struct of_phandle_iterator it; struct device *dev = simple_priv_to_dev(priv); @@ -424,7 +419,6 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, struct device_node *cpu_ep; struct device_node *codec_ep; struct device_node *codec_port; - struct device_node *codec_port_old = NULL; struct asoc_simple_data adata; uintptr_t dpcm_selectable = (uintptr_t)of_device_get_match_data(dev); int rc, ret; @@ -457,8 +451,7 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, if (dpcm_selectable && ((of_get_child_count(codec_port) > 1) || adata.convert_rate || adata.convert_channels)) - ret = func_dpcm(priv, cpu_ep, codec_ep, li, - (codec_port_old == codec_port)); + ret = func_dpcm(priv, cpu_ep, codec_ep, li); /* else normal sound */ else ret = func_noml(priv, cpu_ep, codec_ep, li); @@ -468,8 +461,6 @@ static int graph_for_each_link(struct asoc_simple_priv *priv,
if (ret < 0) return ret; - - codec_port_old = codec_port; } }
@@ -532,19 +523,18 @@ static int graph_count_noml(struct asoc_simple_priv *priv, static int graph_count_dpcm(struct asoc_simple_priv *priv, struct device_node *cpu_ep, struct device_node *codec_ep, - struct link_info *li, - int dup_codec) + struct link_info *li) { struct device *dev = simple_priv_to_dev(priv);
+ /* CPU */ li->link++; /* 1xCPU-dummy */ li->dais++; /* 1xCPU */
- if (!dup_codec) { - li->link++; /* 1xdummy-Codec */ - li->conf++; /* 1xdummy-Codec */ - li->dais++; /* 1xCodec */ - } + /* Codec */ + li->link++; /* 1xdummy-Codec */ + li->conf++; /* 1xdummy-Codec */ + li->dais++; /* 1xCodec */
dev_dbg(dev, "Count As DPCM\n");
Hi Sameer
If a Codec port has multiple endpoints, only first endpoint gets parsed and remaining are ignored. This can be fixed by removing 'dup_codec' flag passed to graph_dai_link_of_dpcm() and thus it loops over all endpoints of Codec. Similarly graph_count_dpcm() is updated as well.
Signed-off-by: Sameer Pujar spujar@nvidia.com
sound/soc/generic/audio-graph-card.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-)
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 1e20562..b1903f9 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -201,8 +201,7 @@ static void graph_parse_mclk_fs(struct device_node *top, static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, struct device_node *cpu_ep, struct device_node *codec_ep,
struct link_info *li,
int dup_codec)
struct link_info *li)
This patch breaks DPCM connection which is used for MIXer
Thank you for your help !!
Best regards --- Kuninori Morimoto
On 7/20/2020 5:07 AM, Kuninori Morimoto wrote:
External email: Use caution opening links or attachments
Hi Sameer
If a Codec port has multiple endpoints, only first endpoint gets parsed and remaining are ignored. This can be fixed by removing 'dup_codec' flag passed to graph_dai_link_of_dpcm() and thus it loops over all endpoints of Codec. Similarly graph_count_dpcm() is updated as well.
Signed-off-by: Sameer Pujar spujar@nvidia.com
sound/soc/generic/audio-graph-card.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-)
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 1e20562..b1903f9 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -201,8 +201,7 @@ static void graph_parse_mclk_fs(struct device_node *top, static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, struct device_node *cpu_ep, struct device_node *codec_ep,
struct link_info *li,
int dup_codec)
struct link_info *li)
This patch breaks DPCM connection which is used for MIXer
Could you please elaborate a bit more as to what is broken with this? The problem I am trying to solve here is to have multiple endpoints for Codec port.
Thank you for your help !!
Best regards
Kuninori Morimoto
Hi Sameer
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 1e20562..b1903f9 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -201,8 +201,7 @@ static void graph_parse_mclk_fs(struct device_node *top, static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, struct device_node *cpu_ep, struct device_node *codec_ep,
struct link_info *li,
int dup_codec)
struct link_info *li)
This patch breaks DPCM connection which is used for MIXer
Could you please elaborate a bit more as to what is broken with this? The problem I am trying to solve here is to have multiple endpoints for Codec port.
For example MIXer, it is like below. If you removes "dup_codec", it breaks MIXer and/or TDM split mode.
CPU0 ---+---- DAI | CPU1 ---+
cpu { ports { port@0 { cpu_0: endpoint { remote-endpoint = <&codec_0>; }; }; port@1 { cpu_1: endpoint { remote-endpoint = <&codec_1>; }; }; }; };
codec { port { codec_0: endpoint { remote-endpoint = <&cpu_0>; }; codec_1: endpoint { remote-endpoint = <&cpu_1>; }; } };
Thank you for your help !!
Best regards --- Kuninori Morimoto
On 7/20/2020 10:43 AM, Kuninori Morimoto wrote:
External email: Use caution opening links or attachments
Hi Sameer
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 1e20562..b1903f9 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -201,8 +201,7 @@ static void graph_parse_mclk_fs(struct device_node *top, static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, struct device_node *cpu_ep, struct device_node *codec_ep,
struct link_info *li,
int dup_codec)
struct link_info *li)
This patch breaks DPCM connection which is used for MIXer
Could you please elaborate a bit more as to what is broken with this? The problem I am trying to solve here is to have multiple endpoints for Codec port.
For example MIXer, it is like below. If you removes "dup_codec", it breaks MIXer and/or TDM split mode.
CPU0 ---+---- DAI | CPU1 ---+ cpu { ports { port@0 { cpu_0: endpoint { remote-endpoint = <&codec_0>; }; }; port@1 { cpu_1: endpoint { remote-endpoint = <&codec_1>; }; }; }; }; codec { port { codec_0: endpoint { remote-endpoint = <&cpu_0>; }; codec_1: endpoint { remote-endpoint = <&cpu_1>; }; } };
Thanks Kuninori for explaining above and for giving a background in an 'off-list' thread. I will re-work on the patch by limiting the changes to specific flag so that it does not affect any other user.
Thank you for your help !!
Best regards
Kuninori Morimoto
For open platforms, which can support pluggable audio cards, Codec endpoint is not fixed always. It actually depends on the compatible HW module that is going to be connected. From SoC side the given I/O interface is always available. Hence such links have fixed CPU endpoint but no Codec endpoint. This patch helps to support such links where user can populate Codec endpoint only and its fields in Platform DT depending on the plugged HW.
Signed-off-by: Sameer Pujar spujar@nvidia.com --- sound/soc/generic/audio-graph-card.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index b1903f9..caa8a77 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -216,6 +216,14 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, struct snd_soc_dai_link_component *codecs = dai_link->codecs; int ret;
+ /* + * Codec endpoint can be NULL for pluggable audio HW. + * Platform DT can populate the Codec endpoint depending on the + * external codec. + */ + if (!ep) + return 0; + port = of_get_parent(ep); ports = of_get_parent(port); node = of_graph_get_port_parent(ep); @@ -532,9 +540,11 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv, li->dais++; /* 1xCPU */
/* Codec */ - li->link++; /* 1xdummy-Codec */ - li->conf++; /* 1xdummy-Codec */ - li->dais++; /* 1xCodec */ + if (codec_ep) { + li->link++; /* 1xdummy-Codec */ + li->conf++; /* 1xdummy-Codec */ + li->dais++; /* 1xCodec */ + }
dev_dbg(dev, "Count As DPCM\n");
PCM devices are created for FE dai links with 'no-pcm' flag as '0'. Such DAI links have CPU component which implement either pcm_construct() or pcm_new() at component or dai level respectively. Based on this, current patch exposes a helper function to identify such components and populate 'no_pcm' flag for DPCM DAI link.
This helps to have BE<->BE component links where PCM devices need not be created for CPU component involved in such links.
Signed-off-by: Sameer Pujar spujar@nvidia.com --- sound/soc/generic/audio-graph-card.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index caa8a77..82d8c740 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -111,6 +111,17 @@ static int graph_get_dai_id(struct device_node *ep) return id; }
+static bool soc_component_is_pcm(struct snd_soc_dai_link_component *dlc) +{ + struct snd_soc_dai *dai = snd_soc_find_dai(dlc); + + if (dai && (dai->component->driver->pcm_construct || + dai->driver->pcm_new)) + return true; + + return false; +} + static int asoc_simple_parse_dai(struct device_node *ep, struct snd_soc_dai_link_component *dlc, int *is_single_link) @@ -262,6 +273,16 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, if (ret < 0) goto out_put_node;
+ /* + * In BE<->BE connections it is not required to create + * PCM devices at CPU end of the dai link and thus 'no_pcm' + * flag needs to be set. It is useful when there are many + * BE components and some of these have to be connected to + * form a valid audio path. + */ + if (!soc_component_is_pcm(cpus)) + dai_link->no_pcm = 1; + /* card->num_links includes Codec */ asoc_simple_canonicalize_cpu(dai_link, is_single_links); } else {
dpcm_end_walk_at_be() stops the graph walk when first BE is found for the given FE component. In a component model we may want to connect multiple DAIs from different components. A new flag is introduced in 'snd_soc_card', which when set allows DAI/component chaining. Later PCM operations can be called for all these listed components for a valid DAPM path.
Signed-off-by: Sameer Pujar spujar@nvidia.com --- include/sound/soc.h | 1 + sound/soc/soc-pcm.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index 59235e5..e1f2405 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1051,6 +1051,7 @@ struct snd_soc_card { int num_of_dapm_widgets; const struct snd_soc_dapm_route *of_dapm_routes; int num_of_dapm_routes; + bool component_chaining;
/* lists of probed devices belonging to this card */ struct list_head component_dev_list; diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index f2c7c85..9de3ec9 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1323,7 +1323,8 @@ int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
/* get number of valid DAI paths and their widgets */ paths = snd_soc_dapm_dai_get_connected_widgets(cpu_dai, stream, list, - dpcm_end_walk_at_be); + fe->card->component_chaining ? + NULL : dpcm_end_walk_at_be);
dev_dbg(fe->dev, "ASoC: found %d audio %s paths\n", paths, stream ? "capture" : "playback");
New compatible "audio-graph-cc-card" is exposed for audio-graph card driver which allows usage of DAI link chaining and thus connects multiple components together in a system.
Signed-off-by: Sameer Pujar spujar@nvidia.com --- Documentation/devicetree/bindings/sound/audio-graph-card.txt | 1 + 1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/sound/audio-graph-card.txt b/Documentation/devicetree/bindings/sound/audio-graph-card.txt index d5f6919..8bf2038 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-card.txt +++ b/Documentation/devicetree/bindings/sound/audio-graph-card.txt @@ -27,6 +27,7 @@ Below are same as Simple-Card. Required properties:
- compatible : "audio-graph-card"; + : "audio-graph-cc-card"; - dais : list of CPU DAI port{s}
Optional properties:
The audio-graph driver supports both normal and DPCM DAI links. The sound cards requiring DPCM DAI link support, use DPCM_SELECTABLE flag and DAI links are treated as DPCM links depending on the number of child nodes in a given DAI link.
There is another requirement where multiple ASoC components need to be connected together in a chained fashion in a component model. This patch sets 'component_chaining' flag for such sound cards where FE<->BE and multiple BE<->BE component connections are required. Hence support for such sound cards is added under 'audio-graph-cc-card' compatible. All DAI links under this are treated as DPCM links.
Signed-off-by: Sameer Pujar spujar@nvidia.com --- sound/soc/generic/audio-graph-card.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 82d8c740..ccfcf5f 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -20,10 +20,13 @@ #include <linux/string.h> #include <sound/simple_card_utils.h>
-#define DPCM_SELECTABLE 1 - #define PREFIX "audio-graph-card,"
+struct asoc_simple_soc_data { + unsigned int dpcm_selectable:1; + unsigned int component_chaining:1; +}; + static int graph_outdrv_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) @@ -449,7 +452,7 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, struct device_node *codec_ep; struct device_node *codec_port; struct asoc_simple_data adata; - uintptr_t dpcm_selectable = (uintptr_t)of_device_get_match_data(dev); + const struct asoc_simple_soc_data *data = of_device_get_match_data(dev); int rc, ret;
/* loop for all listed CPU port */ @@ -476,10 +479,12 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, * It is DPCM * if Codec port has many endpoints, * or has convert-xxx property + * or component chaining is used */ - if (dpcm_selectable && + if (data && data->dpcm_selectable && ((of_get_child_count(codec_port) > 1) || - adata.convert_rate || adata.convert_channels)) + adata.convert_rate || adata.convert_channels || + data->component_chaining)) ret = func_dpcm(priv, cpu_ep, codec_ep, li); /* else normal sound */ else @@ -650,6 +655,7 @@ static int graph_probe(struct platform_device *pdev) { struct asoc_simple_priv *priv; struct device *dev = &pdev->dev; + const struct asoc_simple_soc_data *data = of_device_get_match_data(dev); struct snd_soc_card *card; struct link_info li; int ret; @@ -666,6 +672,9 @@ static int graph_probe(struct platform_device *pdev) card->num_dapm_widgets = ARRAY_SIZE(graph_dapm_widgets); card->probe = graph_card_probe;
+ if (data) + card->component_chaining = data->component_chaining; + memset(&li, 0, sizeof(li)); graph_get_dais_count(priv, &li); if (!li.link || !li.dais) @@ -711,10 +720,19 @@ static int graph_remove(struct platform_device *pdev) return asoc_simple_clean_reference(card); }
+static const struct asoc_simple_soc_data scu_card_data = { + .dpcm_selectable = 1, +}; + +static const struct asoc_simple_soc_data cc_card_data = { + .dpcm_selectable = 1, + .component_chaining = 1, +}; + static const struct of_device_id graph_of_match[] = { { .compatible = "audio-graph-card", }, - { .compatible = "audio-graph-scu-card", - .data = (void *)DPCM_SELECTABLE }, + { .compatible = "audio-graph-scu-card", .data = &scu_card_data, }, + { .compatible = "audio-graph-cc-card", .data = &cc_card_data, }, {}, }; MODULE_DEVICE_TABLE(of, graph_of_match);
Expose a header which describes DT bindings required to use audio-graph based sound card. All Tegra210 based platforms can include this header and add platform specific information. Currently, from SoC point of view, all links are exposed for ADMAIF, AHUB, I2S and DMIC components.
Signed-off-by: Sameer Pujar spujar@nvidia.com --- .../boot/dts/nvidia/tegra210-audio-graph.dtsi | 120 +++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-audio-graph.dtsi
diff --git a/arch/arm64/boot/dts/nvidia/tegra210-audio-graph.dtsi b/arch/arm64/boot/dts/nvidia/tegra210-audio-graph.dtsi new file mode 100644 index 0000000..1cf2c87 --- /dev/null +++ b/arch/arm64/boot/dts/nvidia/tegra210-audio-graph.dtsi @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0 + +/ { + tegra_sound { + status = "disabled"; + + compatible = "audio-graph-cc-card"; + + clocks = <&tegra_car TEGRA210_CLK_PLL_A>, + <&tegra_car TEGRA210_CLK_PLL_A_OUT0>, + <&tegra_car TEGRA210_CLK_EXTERN1>; + clock-names = "pll_a", "plla_out0", "aud_mclk"; + + assigned-clocks = <&tegra_car TEGRA210_CLK_PLL_A>, + <&tegra_car TEGRA210_CLK_PLL_A_OUT0>, + <&tegra_car TEGRA210_CLK_EXTERN1>; + assigned-clock-parents = <0>, <0>, <&tegra_car TEGRA210_CLK_PLL_A_OUT0>; + assigned-clock-rates = <368640000>, <49152000>, <12288000>; + }; +}; + +&tegra_admaif { + admaif_port: port { + admaif0: endpoint@0 { + remote-endpoint = <&xbar_admaif0>; + }; + admaif1: endpoint@1 { + remote-endpoint = <&xbar_admaif1>; + }; + admaif2: endpoint@2 { + remote-endpoint = <&xbar_admaif2>; + }; + admaif3: endpoint@3 { + remote-endpoint = <&xbar_admaif3>; + }; + admaif4: endpoint@4 { + remote-endpoint = <&xbar_admaif4>; + }; + admaif5: endpoint@5 { + remote-endpoint = <&xbar_admaif5>; + }; + admaif6: endpoint@6 { + remote-endpoint = <&xbar_admaif6>; + }; + admaif7: endpoint@7 { + remote-endpoint = <&xbar_admaif7>; + }; + admaif8: endpoint@8 { + remote-endpoint = <&xbar_admaif8>; + }; + admaif9: endpoint@9 { + remote-endpoint = <&xbar_admaif9>; + }; + }; +}; + +&tegra_ahub { + port@0 { + #address-cells = <1>; + #size-cells = <0>; + + /* + * Audio Crossbar Codec endpoints. + * Connected with FE endpoints. + */ + + xbar_admaif0: endpoint@0 { + reg = <0>; + remote-endpoint = <&admaif0>; + }; + xbar_admaif1: endpoint@1 { + reg = <1>; + remote-endpoint = <&admaif1>; + }; + xbar_admaif2: endpoint@2 { + reg = <2>; + remote-endpoint = <&admaif2>; + }; + xbar_admaif3: endpoint@3 { + reg = <3>; + remote-endpoint = <&admaif3>; + }; + xbar_admaif4: endpoint@4 { + reg = <4>; + remote-endpoint = <&admaif4>; + }; + xbar_admaif5: endpoint@5 { + reg = <5>; + remote-endpoint = <&admaif5>; + }; + xbar_admaif6: endpoint@6 { + reg = <6>; + remote-endpoint = <&admaif6>; + }; + xbar_admaif7: endpoint@7 { + reg = <7>; + remote-endpoint = <&admaif7>; + }; + xbar_admaif8: endpoint@8 { + reg = <8>; + remote-endpoint = <&admaif8>; + }; + xbar_admaif9: endpoint@9 { + reg = <9>; + remote-endpoint = <&admaif9>; + }; + }; + + xbar_port: port@1 { + #address-cells = <1>; + #size-cells = <0>; + + /* + * Audio crossbar CPU endpoints: + * Describe connections to HW accelerators (which will + * be addded going forward) and I/O interfaces (which + * are specified in Platform DT files). + */ + }; +};
Hi Sameer
+&tegra_admaif {
- admaif_port: port {
admaif0: endpoint@0 {
remote-endpoint = <&xbar_admaif0>;
};
admaif1: endpoint@1 {
remote-endpoint = <&xbar_admaif1>;
};
(snip)
admaif8: endpoint@8 {
remote-endpoint = <&xbar_admaif8>;
};
admaif9: endpoint@9 {
remote-endpoint = <&xbar_admaif9>;
};
- };
+};
I'm not familiar with your system, so, one question. Does this ADMAIF has total 10 interface which is used in the same time ? or select one of 10 connections when use ?
Thank you for your help !!
Best regards --- Kuninori Morimoto
On 7/20/2020 5:40 AM, Kuninori Morimoto wrote:
External email: Use caution opening links or attachments
Hi Sameer
+&tegra_admaif {
admaif_port: port {
admaif0: endpoint@0 {
remote-endpoint = <&xbar_admaif0>;
};
admaif1: endpoint@1 {
remote-endpoint = <&xbar_admaif1>;
};
(snip)
admaif8: endpoint@8 {
remote-endpoint = <&xbar_admaif8>;
};
admaif9: endpoint@9 {
remote-endpoint = <&xbar_admaif9>;
};
};
+};
I'm not familiar with your system, so, one question. Does this ADMAIF has total 10 interface which is used in the same time ? or select one of 10 connections when use ?
One ore more ADMAIF interfaces can be used simultaneously. In fact all of them can be used at the same time.
Thank you for your help !!
Best regards
Kuninori Morimoto
Hi Sameer
+&tegra_admaif {
admaif_port: port {
admaif0: endpoint@0 {
remote-endpoint = <&xbar_admaif0>;
};
admaif1: endpoint@1 {
remote-endpoint = <&xbar_admaif1>;
};
(snip)
admaif8: endpoint@8 {
remote-endpoint = <&xbar_admaif8>;
};
admaif9: endpoint@9 {
remote-endpoint = <&xbar_admaif9>;
};
};
+};
I'm not familiar with your system, so, one question. Does this ADMAIF has total 10 interface which is used in the same time ? or select one of 10 connections when use ?
One ore more ADMAIF interfaces can be used simultaneously. In fact all of them can be used at the same time.
Ah, sorry my questoin was not correct. I want to clarify was that below.
In my understanding, if your system has 10 interfaces, you need to create 10 ports, not 10 endpoints. If your system has 1 interface, but is connected from 10 devices, it has 1 port 10 endpoints.
Thank you for your help !!
Best regards --- Kuninori Morimoto
On 7/20/2020 10:21 AM, Kuninori Morimoto wrote:
External email: Use caution opening links or attachments
Hi Sameer
+&tegra_admaif {
admaif_port: port {
admaif0: endpoint@0 {
remote-endpoint = <&xbar_admaif0>;
};
admaif1: endpoint@1 {
remote-endpoint = <&xbar_admaif1>;
};
(snip)
admaif8: endpoint@8 {
remote-endpoint = <&xbar_admaif8>;
};
admaif9: endpoint@9 {
remote-endpoint = <&xbar_admaif9>;
};
};
+};
I'm not familiar with your system, so, one question. Does this ADMAIF has total 10 interface which is used in the same time ? or select one of 10 connections when use ?
One ore more ADMAIF interfaces can be used simultaneously. In fact all of them can be used at the same time.
Ah, sorry my questoin was not correct. I want to clarify was that below.
In my understanding, if your system has 10 interfaces, you need to create 10 ports, not 10 endpoints. If your system has 1 interface, but is connected from 10 devices, it has 1 port 10 endpoints.
OK, I see your point. I will work on re-organizing ports/endpoints and once tested will publish V2 for current series. Thanks for inputs.
Thank you for your help !!
Best regards
Kuninori Morimoto
Enable support for audio-graph based sound card on Jetson-Nano and Jetson-TX1. Depending on the platform, required I/O interfaces are enabled.
* Jetson-Nano: Enable I2S3, I2S4, DMIC1 and DMIC2. * Jetson-TX1: Enable all I2S and DMIC interfaces.
Signed-off-by: Sameer Pujar spujar@nvidia.com --- arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 196 +++++++++++++++++++++ arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 110 ++++++++++++ 2 files changed, 306 insertions(+)
diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts b/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts index 56adf28..d228f02 100644 --- a/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts +++ b/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts @@ -3,6 +3,7 @@
#include "tegra210-p2180.dtsi" #include "tegra210-p2597.dtsi" +#include "tegra210-audio-graph.dtsi"
/ { model = "NVIDIA Jetson TX1 Developer Kit"; @@ -126,4 +127,199 @@ status = "okay"; }; }; + + tegra_sound { + status = "okay"; + + dais = /* FE */ + <&admaif_port>, + /* Router */ + <&xbar_port>, + /* I/O DAP Ports */ + <&i2s1_port>, <&i2s2_port>, <&i2s3_port>, <&i2s4_port>, <&i2s5_port>, + <&dmic1_port>, <&dmic2_port>, <&dmic3_port>; + + label = "jetson-tx1-ape"; + }; +}; + +&tegra_admaif { + status = "okay"; +}; + +&tegra_ahub { + status = "okay"; + + port@1 { + xbar_i2s1: endpoint@a { + reg = <0xa>; + remote-endpoint = <&i2s1_cif>; + }; + xbar_i2s2: endpoint@b { + reg = <0xb>; + remote-endpoint = <&i2s2_cif>; + }; + xbar_i2s3: endpoint@c { + reg = <0xc>; + remote-endpoint = <&i2s3_cif>; + }; + xbar_i2s4: endpoint@d { + reg = <0xd>; + remote-endpoint = <&i2s4_cif>; + }; + xbar_i2s5: endpoint@e { + reg = <0xe>; + remote-endpoint = <&i2s5_cif>; + }; + xbar_dmic1: endpoint@f { + reg = <0xf>; + remote-endpoint = <&dmic1_cif>; + }; + xbar_dmic2: endpoint@10 { + reg = <0x10>; + remote-endpoint = <&dmic2_cif>; + }; + xbar_dmic3: endpoint@11 { + reg = <0x11>; + remote-endpoint = <&dmic3_cif>; + }; + }; +}; + +&tegra_i2s1 { + status = "okay"; + + port@0 { + i2s1_cif: endpoint@0 { + remote-endpoint = <&xbar_i2s1>; + }; + }; + + i2s1_port: port@1 { + i2s1_dap: endpoint@0 { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_i2s2 { + status = "okay"; + + port@0 { + i2s2_cif: endpoint@0 { + remote-endpoint = <&xbar_i2s2>; + }; + }; + + i2s2_port: port@1 { + i2s2_dap: endpoint@0 { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_i2s3 { + status = "okay"; + + port@0 { + i2s3_cif: endpoint@0 { + remote-endpoint = <&xbar_i2s3>; + }; + }; + + i2s3_port: port@1 { + i2s3_dap: endpoint@0 { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_i2s4 { + status = "okay"; + + port@0 { + i2s4_cif: endpoint@0 { + remote-endpoint = <&xbar_i2s4>; + }; + }; + + i2s4_port: port@1 { + i2s4_dap: endpoint@0 { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_i2s5 { + status = "okay"; + + port@0 { + i2s5_cif: endpoint@0 { + remote-endpoint = <&xbar_i2s5>; + }; + }; + + i2s5_port: port@1 { + i2s5_dap: endpoint@0 { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_dmic1 { + status = "okay"; + + port@0 { + dmic1_cif: endpoint@0 { + remote-endpoint = <&xbar_dmic1>; + }; + }; + + dmic1_port: port@1 { + dmic1_dap: endpoint@0 { + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_dmic2 { + status = "okay"; + + port@0 { + dmic2_cif: endpoint@0 { + remote-endpoint = <&xbar_dmic2>; + }; + }; + + dmic2_port: port@1 { + dmic2_dap: endpoint@0 { + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_dmic3 { + status = "okay"; + + port@0 { + dmic3_cif: endpoint@0 { + remote-endpoint = <&xbar_dmic3>; + }; + }; + + dmic3_port: port@1 { + dmic3_dap: endpoint@0 { + /* Placeholder for external Codec */ + }; + }; }; diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts b/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts index 0325fc0..0226297 100644 --- a/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts +++ b/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts @@ -6,6 +6,7 @@ #include <dt-bindings/mfd/max77620.h>
#include "tegra210.dtsi" +#include "tegra210-audio-graph.dtsi"
/ { model = "NVIDIA Jetson Nano Developer Kit"; @@ -818,4 +819,113 @@ status = "okay"; }; }; + + tegra_sound { + status = "okay"; + + dais = /* FE */ + <&admaif_port>, + /* Router */ + <&xbar_port>, + /* I/O DAP Ports */ + <&i2s3_port>, <&i2s4_port>, + <&dmic1_port>, <&dmic2_port>; + + label = "jetson-nano-ape"; + }; +}; + +&tegra_admaif { + status = "okay"; +}; + +&tegra_ahub { + status = "okay"; + + port@1 { + xbar_i2s3: endpoint@c { + reg = <0xc>; + remote-endpoint = <&i2s3_cif>; + }; + xbar_i2s4: endpoint@d { + reg = <0xd>; + remote-endpoint = <&i2s4_cif>; + }; + xbar_dmic1: endpoint@f { + reg = <0xf>; + remote-endpoint = <&dmic1_cif>; + }; + xbar_dmic2: endpoint@10 { + reg = <0x10>; + remote-endpoint = <&dmic2_cif>; + }; + }; +}; + +&tegra_i2s3 { + status = "okay"; + + port@0 { + i2s3_cif: endpoint@0 { + remote-endpoint = <&xbar_i2s3>; + }; + }; + + i2s3_port: port@1 { + i2s3_dap: endpoint@0 { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_i2s4 { + status = "okay"; + + port@0 { + i2s4_cif: endpoint@0 { + remote-endpoint = <&xbar_i2s4>; + }; + }; + + i2s4_port: port@1 { + i2s4_dap: endpoint@0 { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_dmic1 { + status = "okay"; + + port@0 { + dmic1_cif: endpoint@0 { + remote-endpoint = <&xbar_dmic1>; + }; + }; + + dmic1_port: port@1 { + dmic1_dap: endpoint@0 { + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_dmic2 { + status = "okay"; + + port@0 { + dmic2_cif: endpoint@0 { + remote-endpoint = <&xbar_dmic2>; + }; + }; + + dmic2_port: port@1 { + dmic2_dap: endpoint@0 { + /* Placeholder for external Codec */ + }; + }; };
participants (2)
-
Kuninori Morimoto
-
Sameer Pujar