Extend AHUB audio support for Tegra210 and later
Subsystems (5)
cover Extend AHUB audio support for Tegra210 and later
Earlier as part of series [0], support for ADMAIF and I/O modules (such as I2S, DMIC and DSPK) was added. This series aims at exposing some of the AHUB internal modules (listed below), which can be used for audio pre or post processing.
* SFC (Sampling Frequency Converter)
* MVC (Master Volume Control)
* AMX (Audio Multiplexer)
* ADX (Audio Demultiplexer)
* Mixer
These modules can be plugged into audio paths and relevant processing can be done. The MUX routes are extended to allow add or remove above modules in the path via mixer controls. This is similar to how specific ADMAIF channels are connected to relevant I/O module instances at the moment.
Some of these modules can alter PCM parameters. Consider example of resampler (44.1 -> 48 kHz) in the path.
aplay(44.1 kHz) -> ADMAIF -> SFC -> (48 kHz) I2S -> (48kHz) Codec
The modules following SFC should be using converted sample rate and DAIs need to be configured accordingly. The audio-graph driver provides a mechanism to fixup the new parameters which can be specified in DT for a given DAI. Then core uses these new values via fixup callback and then pass it to respective DAIs hw_param() callback. The "convert-rate", described in [1], property can be used when there is rate conversion in the audio path. Similarly "convert-channels" can be used when there is channel conversion in the path. There is no "convert-xxx" property for sample size conversions. It can be added if necessary.
[0] https://www.lkml.org/lkml/2020/7/21/1357
[1] Documentation/devicetree/bindings/sound/audio-graph-port.yaml
Sameer Pujar (13):
ASoC: soc-pcm: Don't reconnect an already active BE
ASoC: simple-card-utils: Increase maximum DAI links limit to 512
ASoC: audio-graph: Fixup CPU endpoint hw_params in a BE<->BE link
ASoC: dt-bindings: tegra: Few more Tegra210 AHUB modules
ASoC: tegra: Add routes for few AHUB modules
ASoC: tegra: Add Tegra210 based MVC driver
ASoC: tegra: Add Tegra210 based SFC driver
ASoC: tegra: Add Tegra210 based AMX driver
ASoC: tegra: Add Tegra210 based ADX driver
ASoC: tegra: Add Tegra210 based Mixer driver
arm64: defconfig: Enable few Tegra210 based AHUB drivers
arm64: tegra: Add few AHUB devices for Tegra210 and later
arm64: tegra: Extend APE audio support on Jetson platforms
.../bindings/sound/nvidia,tegra210-adx.yaml | 74 + .../bindings/sound/nvidia,tegra210-ahub.yaml | 20 + .../bindings/sound/nvidia,tegra210-amx.yaml | 72 + .../bindings/sound/nvidia,tegra210-mixer.yaml | 67 + .../bindings/sound/nvidia,tegra210-mvc.yaml | 79 + .../bindings/sound/nvidia,tegra210-sfc.yaml | 76 + arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 1554 ++++++++- arch/arm64/boot/dts/nvidia/tegra186.dtsi | 120 + arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts | 1493 ++++++++- .../arm64/boot/dts/nvidia/tegra194-p3509-0000.dtsi | 1520 ++++++++- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 116 + arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 876 +++++ arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 876 +++++ arch/arm64/boot/dts/nvidia/tegra210.dtsi | 77 + arch/arm64/configs/defconfig | 5 + include/sound/simple_card_utils.h | 2 +- sound/soc/generic/audio-graph-card.c | 4 +- sound/soc/soc-pcm.c | 4 + sound/soc/tegra/Kconfig | 48 + sound/soc/tegra/Makefile | 10 + sound/soc/tegra/tegra210_adx.c | 527 +++ sound/soc/tegra/tegra210_adx.h | 72 + sound/soc/tegra/tegra210_ahub.c | 511 ++- sound/soc/tegra/tegra210_amx.c | 595 ++++ sound/soc/tegra/tegra210_amx.h | 93 + sound/soc/tegra/tegra210_mixer.c | 667 ++++ sound/soc/tegra/tegra210_mixer.h | 100 + sound/soc/tegra/tegra210_mvc.c | 629 ++++ sound/soc/tegra/tegra210_mvc.h | 117 + sound/soc/tegra/tegra210_sfc.c | 3542 ++++++++++++++++++++ sound/soc/tegra/tegra210_sfc.h | 78 + 31 files changed, 13601 insertions(+), 423 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-amx.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-mixer.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-mvc.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-sfc.yaml create mode 100644 sound/soc/tegra/tegra210_adx.c create mode 100644 sound/soc/tegra/tegra210_adx.h create mode 100644 sound/soc/tegra/tegra210_amx.c create mode 100644 sound/soc/tegra/tegra210_amx.h create mode 100644 sound/soc/tegra/tegra210_mixer.c create mode 100644 sound/soc/tegra/tegra210_mixer.h create mode 100644 sound/soc/tegra/tegra210_mvc.c create mode 100644 sound/soc/tegra/tegra210_mvc.h create mode 100644 sound/soc/tegra/tegra210_sfc.c create mode 100644 sound/soc/tegra/tegra210_sfc.h
Signature · 1 line
2.7.4
PATCH 1/13 ASoC: soc-pcm: Don't reconnect an already active BE
In some cases, multiple FE components have the same BE component in their respective DPCM paths. One such example would be a mixer component, which can receive two or more inputs and sends a mixed output. In such cases, to avoid reconfiguration of already active DAI (mixer output DAI in this case), check the BE stream state to filter out the redundancy.
In summary, allow connection of BE if the respective current stream state is either NEW or CLOSED.
--- sound/soc/soc-pcm.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/soc-pcm.c +4 -0
@@ -1395,6 +1395,10 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,if (!fe->dpcm[stream].runtime && !fe->fe_compr)continue ; +if ((be->dpcm[stream].state !=SND_SOC_DPCM_STATE_NEW ) && + (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_CLOSE )) +continue ; +/* newly connected FE and BE */ err =dpcm_be_connect (fe, be, stream);if (err <0 ) {
Signature · 1 line
2.7.4
PATCH 2/13 ASoC: simple-card-utils: Increase maximum DAI links limit to 512
In reply to Sameer PujarThe current limit of 128 is not sufficient when more components are added to the audio map on Tegra210 and later platforms. Thus it is resulting in probe failure.
The requirement is of nearly ~200 DAI links. To give sufficient room for future additions the maximum limit is increased to 512 DAI links. This is a preparatory patch to add more components like resampler, mixer, multiplexers, demultiplexers and volume controllers to Tegra210 and later platforms.
--- include/sound/simple_card_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/sound/simple_card_utils.h +1 -1
@@ -115,7 +115,7 @@ struct asoc_simple_priv { ((codec) =simple_props_to_dai_codec (props, i)); \ (i)++) -#define SNDRV_MAX_LINKS 128 +#define SNDRV_MAX_LINKS 512struct link_info {int link;/* number of link */
Signature · 1 line
2.7.4
PATCH 3/13 ASoC: audio-graph: Fixup CPU endpoint hw_params in a BE<->BE link
In reply to Sameer PujarWhen multiple components are connected back to back in an audio path, hw_param fixup may be required for CPU or Codec endpoint of BE<->BE DAI links. Currently fixup support is available for Codec and this commit adds similar feature for CPU endpoint of a BE<->BE link.
For example a resampler component can be plugged into an audio path.
[ FE -> BE1 -> ... -> resampler -> ... BEn ]
The resampler DAI links can be:
BEx (CPU) -> resampler input (Codec)
resampler output (CPU) -> BEy (Codec)
Thus input and output sample rate parameters for resampler can be fixed up as per the resample requirement.
--- sound/soc/generic/audio-graph-card.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/generic/audio-graph-card.c +3 -1
@@ -309,8 +309,10 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,* For example: FE <-> BE1 <-> BE2 <-> ... <-> BEn where * there are 'n' BE components in the path. */ -if (card->component_chaining && !soc_component_is_pcm (cpus)) +if (card->component_chaining && !soc_component_is_pcm (cpus)) { dai_link->no_pcm =1 ; + dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup; + }asoc_simple_canonicalize_cpu (cpus, is_single_links); }else {
Signature · 1 line
2.7.4
PATCH 4/13 ASoC: dt-bindings: tegra: Few more Tegra210 AHUB modules
In reply to Sameer PujarThis patch adds YAML schema for DT bindings of few AHUB modules. These devices will be registered as ASoC components and bindings will be used on Tegra210 and later chips. The bindings for below mentioned modules are added:
* SFC (Sampling Frequency Converter)
* MVC (Master Volume Control)
* AMX (Audio Multiplexer)
* ADX (Audio Demultiplexer)
* Mixer
--- .../bindings/sound/nvidia,tegra210-adx.yaml | 74 ++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-ahub.yaml | 20 ++++++ .../bindings/sound/nvidia,tegra210-amx.yaml | 72 ++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-mixer.yaml | 67 ++++++++++++++++++ .../bindings/sound/nvidia,tegra210-mvc.yaml | 79 ++++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-sfc.yaml | 76 +++++++++++++++++++++ 6 files changed, 388 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-amx.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-mixer.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-mvc.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-sfc.yaml
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml new file +74 -0
@@ -0,0 +1,74 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra210-adx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Tegra210 ADX Device Tree Bindings + +description: | + The Audio Demultiplexer (ADX) block takes an input stream with up to + 16 channels and demultiplexes it into four output streams of up to 16 + channels each. A byte RAM helps to form output frames by any combination + of bytes from the input frame. Its design is identical to that of byte + RAM in the AMX except that the data flow direction is reversed. + +maintainers: + - Jon Hunter <[email protected]> + - Mohan Kumar <[email protected]> + - Sameer Pujar <[email protected]> + +properties: + $nodename: + pattern: "^adx@[0-9a-f]*$" + + compatible: + oneOf: + - const: nvidia,tegra210-adx + - items: + - enum: + - nvidia,tegra194-adx + - nvidia,tegra186-adx + - const: nvidia,tegra210-adx + + reg: + maxItems: 1 + + sound-name-prefix: + pattern: "^ADX[1-9]$" + $ref: /schemas/types.yaml#/definitions/string + description: + used as prefix for sink/source names of the component. Must be a + unique string among multiple instances of the same component. + The name can be "ADX1" or "ADX2" ... "ADXx", where x depends on + the maximum available instances on a Tegra SoC. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + description: | + ADX has one input and four output. Accordingly ACIF (Audio Client + Interface) RX and TX port nodes are defined to represent ADX inputs + and output respectively. These are connected to corresponding ports + on AHUB. + + patternProperties: + '^port@[0-9]': + $ref: audio-graph-port.yaml# + unevaluatedProperties: false + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + + adx@702d3800 { + compatible = "nvidia,tegra210-adx"; + reg = <0x702d3800 0x100>; + sound-name-prefix = "ADX1"; + }; + +...
Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml +20 -0
@@ -85,6 +85,26 @@ patternProperties: type: object $ref: nvidia,tegra186-dspk.yaml# + '^mvc@[0-9a-f]+$': + type: object + $ref: nvidia,tegra210-mvc.yaml# + + '^sfc@[0-9a-f]+$': + type: object + $ref: nvidia,tegra210-sfc.yaml# + + '^amx@[0-9a-f]+$': + type: object + $ref: nvidia,tegra210-amx.yaml# + + '^adx@[0-9a-f]+$': + type: object + $ref: nvidia,tegra210-adx.yaml# + + '^mixer@[0-9a-f]+$': + type: object + $ref: nvidia,tegra210-mixer.yaml# + required: - compatible - reg
Documentation/devicetree/bindings/sound/nvidia,tegra210-amx.yaml new file +72 -0
72 lines not on this page · raw message
Documentation/devicetree/bindings/sound/nvidia,tegra210-mixer.yaml new file +67 -0
67 lines not on this page · raw message
Documentation/devicetree/bindings/sound/nvidia,tegra210-mvc.yaml new file +79 -0
79 lines not on this page · raw message
Documentation/devicetree/bindings/sound/nvidia,tegra210-sfc.yaml new file +76 -0
76 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 5/13 ASoC: tegra: Add routes for few AHUB modules
In reply to Sameer PujarAdd routing support for following modules of AHUB:
* SFC (Sampling Frequency Converter)
* MVC (Master Volume Control)
* AMX (Audio Multiplexer)
* ADX (Audio Demultiplexer)
* Mixer
These modules can be plugged into audio path as per the need using routing controls similar to the already existing routes to I/O modules such as I2S, DMIC and DSPK.
--- sound/soc/tegra/tegra210_ahub.c | 511 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 509 insertions(+), 2 deletions(-)
sound/soc/tegra/tegra210_ahub.c +509 -2
@@ -105,14 +105,68 @@ static struct snd_soc_dai_driver tegra210_ahub_dais[] = {DAI (ADMAIF8 ),DAI (ADMAIF9 ),DAI (ADMAIF10 ), +/* XBAR <-> I2S <-> Codec */ DAI (I2S1 ),DAI (I2S2 ),DAI (I2S3 ),DAI (I2S4 ),DAI (I2S5 ), +/* XBAR <- DMIC <- Codec */ DAI (DMIC1 ),DAI (DMIC2 ),DAI (DMIC3 ), +/* XBAR -> SFC -> XBAR */ +DAI (SFC1 RX ), +DAI (SFC1 TX ), +DAI (SFC2 RX ), +DAI (SFC2 TX ), +DAI (SFC3 RX ), +DAI (SFC3 TX ), +DAI (SFC4 RX ), +DAI (SFC4 TX ), +/* XBAR -> MVC -> XBAR */ +DAI (MVC1 RX ), +DAI (MVC1 TX ), +DAI (MVC2 RX ), +DAI (MVC2 TX ), +/* XBAR -> AMX(4:1) -> XBAR */ +DAI (AMX1 RX1 ), +DAI (AMX1 RX2 ), +DAI (AMX1 RX3 ), +DAI (AMX1 RX4 ), +DAI (AMX1 ), +DAI (AMX2 RX1 ), +DAI (AMX2 RX2 ), +DAI (AMX2 RX3 ), +DAI (AMX2 RX4 ), +DAI (AMX2 ), +/* XBAR -> ADX(1:4) -> XBAR */ +DAI (ADX1 ), +DAI (ADX1 TX1 ), +DAI (ADX1 TX2 ), +DAI (ADX1 TX3 ), +DAI (ADX1 TX4 ), +DAI (ADX2 ), +DAI (ADX2 TX1 ), +DAI (ADX2 TX2 ), +DAI (ADX2 TX3 ), +DAI (ADX2 TX4 ), +/* XBAR -> MIXER(10:5) -> XBAR */ +DAI (MIXER RX1 ), +DAI (MIXER RX2 ), +DAI (MIXER RX3 ), +DAI (MIXER RX4 ), +DAI (MIXER RX5 ), +DAI (MIXER RX6 ), +DAI (MIXER RX7 ), +DAI (MIXER RX8 ), +DAI (MIXER RX9 ), +DAI (MIXER RX10 ), +DAI (MIXER TX1 ), +DAI (MIXER TX2 ), +DAI (MIXER TX3 ), +DAI (MIXER TX4 ), + DAI(MIXER TX5), };static struct snd_soc_dai_driver tegra186_ahub_dais[] = {
@@ -136,18 +190,93 @@ static struct snd_soc_dai_driver tegra186_ahub_dais[] = {DAI (ADMAIF18 ),DAI (ADMAIF19 ),DAI (ADMAIF20 ), +/* XBAR <-> I2S <-> Codec */ DAI (I2S1 ),DAI (I2S2 ),DAI (I2S3 ),DAI (I2S4 ),DAI (I2S5 ),DAI (I2S6 ), +/* XBAR <- DMIC <- Codec */ DAI (DMIC1 ),DAI (DMIC2 ),DAI (DMIC3 ),DAI (DMIC4 ), +/* XBAR -> DSPK -> Codec */ DAI (DSPK1 ),DAI (DSPK2 ), +/* XBAR -> SFC -> XBAR */ +DAI (SFC1 RX ), +DAI (SFC1 TX ), +DAI (SFC2 RX ), +DAI (SFC2 TX ), +DAI (SFC3 RX ), +DAI (SFC3 TX ), +DAI (SFC4 RX ), +DAI (SFC4 TX ), +/* XBAR -> MVC -> XBAR */ +DAI (MVC1 RX ), +DAI (MVC1 TX ), +DAI (MVC2 RX ), +DAI (MVC2 TX ), +/* XBAR -> AMX(4:1) -> XBAR */ +DAI (AMX1 RX1 ), +DAI (AMX1 RX2 ), +DAI (AMX1 RX3 ), +DAI (AMX1 RX4 ), +DAI (AMX1 ), +DAI (AMX2 RX1 ), +DAI (AMX2 RX2 ), +DAI (AMX2 RX3 ), +DAI (AMX2 RX4 ), +DAI (AMX2 ), +DAI (AMX3 RX1 ), +DAI (AMX3 RX2 ), +DAI (AMX3 RX3 ), +DAI (AMX3 RX4 ), +DAI (AMX3 ), +DAI (AMX4 RX1 ), +DAI (AMX4 RX2 ), +DAI (AMX4 RX3 ), +DAI (AMX4 RX4 ), +DAI (AMX4 ), +/* XBAR -> ADX(1:4) -> XBAR */ +DAI (ADX1 ), +DAI (ADX1 TX1 ), +DAI (ADX1 TX2 ), +DAI (ADX1 TX3 ), +DAI (ADX1 TX4 ), +DAI (ADX2 ), +DAI (ADX2 TX1 ), +DAI (ADX2 TX2 ), +DAI (ADX2 TX3 ), +DAI (ADX2 TX4 ), +DAI (ADX3 ), +DAI (ADX3 TX1 ), +DAI (ADX3 TX2 ), +DAI (ADX3 TX3 ), +DAI (ADX3 TX4 ), +DAI (ADX4 ), +DAI (ADX4 TX1 ), +DAI (ADX4 TX2 ), +DAI (ADX4 TX3 ), +DAI (ADX4 TX4 ), +/* XBAR -> MIXER(10:5) -> XBAR */ +DAI (MIXER RX1 ), +DAI (MIXER RX2 ), +DAI (MIXER RX3 ), +DAI (MIXER RX4 ), +DAI (MIXER RX5 ), +DAI (MIXER RX6 ), +DAI (MIXER RX7 ), +DAI (MIXER RX8 ), +DAI (MIXER RX9 ), +DAI (MIXER RX10 ), +DAI (MIXER TX1 ), +DAI (MIXER TX2 ), +DAI (MIXER TX3 ), +DAI (MIXER TX4 ), + DAI(MIXER TX5), };static const char *const tegra210_ahub_mux_texts[] = {
@@ -170,6 +299,27 @@ static const char * const tegra210_ahub_mux_texts[] = {"DMIC1" ,"DMIC2" ,"DMIC3" , +"SFC1" , +"SFC2" , +"SFC3" , +"SFC4" , +"MVC1" , +"MVC2" , +"AMX1" , +"AMX2" , +"ADX1 TX1" , +"ADX1 TX2" , +"ADX1 TX3" , +"ADX1 TX4" , +"ADX2 TX1" , +"ADX2 TX2" , +"ADX2 TX3" , +"ADX2 TX4" , +"MIXER TX1" , +"MIXER TX2" , +"MIXER TX3" , +"MIXER TX4" , + "MIXER TX5", }; static const char * const tegra186_ahub_mux_texts[] = {
@@ -204,10 +354,42 @@ static const char * const tegra186_ahub_mux_texts[] = {"DMIC2" ,"DMIC3" ,"DMIC4" , +"SFC1" , +"SFC2" , +"SFC3" , +"SFC4" , +"MVC1" , +"MVC2" , +"AMX1" , +"AMX2" , +"AMX3" , +"AMX4" , +"ADX1 TX1" , +"ADX1 TX2" , +"ADX1 TX3" , +"ADX1 TX4" , +"ADX2 TX1" , +"ADX2 TX2" , +"ADX2 TX3" , +"ADX2 TX4" , +"ADX3 TX1" , +"ADX3 TX2" , +"ADX3 TX3" , +"ADX3 TX4" , +"ADX4 TX1" , +"ADX4 TX2" , +"ADX4 TX3" , +"ADX4 TX4" , +"MIXER TX1" , +"MIXER TX2" , +"MIXER TX3" , +"MIXER TX4" , + "MIXER TX5", };static const unsigned int tegra210_ahub_mux_values[] = {0 , +/* ADMAIF */ MUX_VALUE (0 ,0 ),MUX_VALUE (0 ,1 ), MUX_VALUE(0, 2),
@@ -218,18 +400,47 @@ static const unsigned int tegra210_ahub_mux_values[] = {MUX_VALUE (0 ,7 ),MUX_VALUE (0 ,8 ),MUX_VALUE (0 ,9 ), +/* I2S */ MUX_VALUE (0 ,16 ),MUX_VALUE (0 ,17 ),MUX_VALUE (0 ,18 ),MUX_VALUE (0 ,19 ),MUX_VALUE (0 ,20 ), +/* DMIC */ MUX_VALUE (2 ,18 ),MUX_VALUE (2 ,19 ),MUX_VALUE (2 ,20 ), +/* SFC */ +MUX_VALUE (0 ,24 ), +MUX_VALUE (0 ,25 ), +MUX_VALUE (0 ,26 ), +MUX_VALUE (0 ,27 ), +/* MVC */ +MUX_VALUE (2 ,8 ), +MUX_VALUE (2 ,9 ), +/* AMX */ +MUX_VALUE (1 ,8 ), +MUX_VALUE (1 ,9 ), +/* ADX */ +MUX_VALUE (2 ,24 ), +MUX_VALUE (2 ,25 ), +MUX_VALUE (2 ,26 ), +MUX_VALUE (2 ,27 ), +MUX_VALUE (2 ,28 ), +MUX_VALUE (2 ,29 ), +MUX_VALUE (2 ,30 ), +MUX_VALUE (2 ,31 ), +/* MIXER */ +MUX_VALUE (1 ,0 ), +MUX_VALUE (1 ,1 ), +MUX_VALUE (1 ,2 ), +MUX_VALUE (1 ,3 ), + MUX_VALUE(1, 4), };static const unsigned int tegra186_ahub_mux_values[] = {0 , +/* ADMAIF */ MUX_VALUE (0 ,0 ),MUX_VALUE (0 ,1 ), MUX_VALUE(0, 2),
@@ -246,20 +457,59 @@ static const unsigned int tegra186_ahub_mux_values[] = {MUX_VALUE (0 ,13 ),MUX_VALUE (0 ,14 ),MUX_VALUE (0 ,15 ), +/* I2S */ MUX_VALUE (0 ,16 ),MUX_VALUE (0 ,17 ),MUX_VALUE (0 ,18 ),MUX_VALUE (0 ,19 ),MUX_VALUE (0 ,20 ),MUX_VALUE (0 ,21 ), +/* ADMAIF */ MUX_VALUE (3 ,16 ),MUX_VALUE (3 ,17 ),MUX_VALUE (3 ,18 ),MUX_VALUE (3 ,19 ), +/* DMIC */ MUX_VALUE (2 ,18 ),MUX_VALUE (2 ,19 ),MUX_VALUE (2 ,20 ),MUX_VALUE (2 ,21 ), +/* SFC */ +MUX_VALUE (0 ,24 ), +MUX_VALUE (0 ,25 ), +MUX_VALUE (0 ,26 ), +MUX_VALUE (0 ,27 ), +/* MVC */ +MUX_VALUE (2 ,8 ), +MUX_VALUE (2 ,9 ), +/* AMX */ +MUX_VALUE (1 ,8 ), +MUX_VALUE (1 ,9 ), +MUX_VALUE (1 ,10 ), +MUX_VALUE (1 ,11 ), +/* ADX */ +MUX_VALUE (2 ,24 ), +MUX_VALUE (2 ,25 ), +MUX_VALUE (2 ,26 ), +MUX_VALUE (2 ,27 ), +MUX_VALUE (2 ,28 ), +MUX_VALUE (2 ,29 ), +MUX_VALUE (2 ,30 ), +MUX_VALUE (2 ,31 ), +MUX_VALUE (3 ,0 ), +MUX_VALUE (3 ,1 ), +MUX_VALUE (3 ,2 ), +MUX_VALUE (3 ,3 ), +MUX_VALUE (3 ,4 ), +MUX_VALUE (3 ,5 ), +MUX_VALUE (3 ,6 ), +MUX_VALUE (3 ,7 ), +/* MIXER */ +MUX_VALUE (1 ,0 ), +MUX_VALUE (1 ,1 ), +MUX_VALUE (1 ,2 ), +MUX_VALUE (1 ,3 ), + MUX_VALUE(1, 4), };/* Controls for t210 */
@@ -278,6 +528,32 @@ MUX_ENUM_CTRL_DECL(t210_i2s2_tx, 0x11);MUX_ENUM_CTRL_DECL (t210_i2s3_tx,0x12 );MUX_ENUM_CTRL_DECL (t210_i2s4_tx,0x13 );MUX_ENUM_CTRL_DECL (t210_i2s5_tx,0x14 ); +MUX_ENUM_CTRL_DECL (t210_sfc1_tx,0x18 ); +MUX_ENUM_CTRL_DECL (t210_sfc2_tx,0x19 ); +MUX_ENUM_CTRL_DECL (t210_sfc3_tx,0x1a ); +MUX_ENUM_CTRL_DECL (t210_sfc4_tx,0x1b ); +MUX_ENUM_CTRL_DECL (t210_mvc1_tx,0x48 ); +MUX_ENUM_CTRL_DECL (t210_mvc2_tx,0x49 ); +MUX_ENUM_CTRL_DECL (t210_amx11_tx,0x50 ); +MUX_ENUM_CTRL_DECL (t210_amx12_tx,0x51 ); +MUX_ENUM_CTRL_DECL (t210_amx13_tx,0x52 ); +MUX_ENUM_CTRL_DECL (t210_amx14_tx,0x53 ); +MUX_ENUM_CTRL_DECL (t210_amx21_tx,0x54 ); +MUX_ENUM_CTRL_DECL (t210_amx22_tx,0x55 ); +MUX_ENUM_CTRL_DECL (t210_amx23_tx,0x56 ); +MUX_ENUM_CTRL_DECL (t210_amx24_tx,0x57 ); +MUX_ENUM_CTRL_DECL (t210_adx1_tx,0x58 ); +MUX_ENUM_CTRL_DECL (t210_adx2_tx,0x59 ); +MUX_ENUM_CTRL_DECL (t210_mixer11_tx,0x20 ); +MUX_ENUM_CTRL_DECL (t210_mixer12_tx,0x21 ); +MUX_ENUM_CTRL_DECL (t210_mixer13_tx,0x22 ); +MUX_ENUM_CTRL_DECL (t210_mixer14_tx,0x23 ); +MUX_ENUM_CTRL_DECL (t210_mixer15_tx,0x24 ); +MUX_ENUM_CTRL_DECL (t210_mixer16_tx,0x25 ); +MUX_ENUM_CTRL_DECL (t210_mixer17_tx,0x26 ); +MUX_ENUM_CTRL_DECL (t210_mixer18_tx,0x27 ); +MUX_ENUM_CTRL_DECL (t210_mixer19_tx,0x28 ); +MUX_ENUM_CTRL_DECL (t210_mixer110_tx,0x29 );/* Controls for t186 */ MUX_ENUM_CTRL_DECL_186 (t186_admaif1_tx,0x00 );
@@ -308,6 +584,42 @@ MUX_ENUM_CTRL_DECL_186(t186_admaif17_tx, 0x68);MUX_ENUM_CTRL_DECL_186 (t186_admaif18_tx,0x69 );MUX_ENUM_CTRL_DECL_186 (t186_admaif19_tx,0x6a );MUX_ENUM_CTRL_DECL_186 (t186_admaif20_tx,0x6b ); +MUX_ENUM_CTRL_DECL_186 (t186_sfc1_tx,0x18 ); +MUX_ENUM_CTRL_DECL_186 (t186_sfc2_tx,0x19 ); +MUX_ENUM_CTRL_DECL_186 (t186_sfc3_tx,0x1a ); +MUX_ENUM_CTRL_DECL_186 (t186_sfc4_tx,0x1b ); +MUX_ENUM_CTRL_DECL_186 (t186_mvc1_tx,0x48 ); +MUX_ENUM_CTRL_DECL_186 (t186_mvc2_tx,0x49 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx11_tx,0x50 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx12_tx,0x51 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx13_tx,0x52 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx14_tx,0x53 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx21_tx,0x54 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx22_tx,0x55 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx23_tx,0x56 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx24_tx,0x57 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx31_tx,0x58 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx32_tx,0x59 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx33_tx,0x5a ); +MUX_ENUM_CTRL_DECL_186 (t186_amx34_tx,0x5b ); +MUX_ENUM_CTRL_DECL_186 (t186_amx41_tx,0x64 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx42_tx,0x65 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx43_tx,0x66 ); +MUX_ENUM_CTRL_DECL_186 (t186_amx44_tx,0x67 ); +MUX_ENUM_CTRL_DECL_186 (t186_adx1_tx,0x60 ); +MUX_ENUM_CTRL_DECL_186 (t186_adx2_tx,0x61 ); +MUX_ENUM_CTRL_DECL_186 (t186_adx3_tx,0x62 ); +MUX_ENUM_CTRL_DECL_186 (t186_adx4_tx,0x63 ); +MUX_ENUM_CTRL_DECL_186 (t186_mixer11_tx,0x20 ); +MUX_ENUM_CTRL_DECL_186 (t186_mixer12_tx,0x21 ); +MUX_ENUM_CTRL_DECL_186 (t186_mixer13_tx,0x22 ); +MUX_ENUM_CTRL_DECL_186 (t186_mixer14_tx,0x23 ); +MUX_ENUM_CTRL_DECL_186 (t186_mixer15_tx,0x24 ); +MUX_ENUM_CTRL_DECL_186 (t186_mixer16_tx,0x25 ); +MUX_ENUM_CTRL_DECL_186 (t186_mixer17_tx,0x26 ); +MUX_ENUM_CTRL_DECL_186 (t186_mixer18_tx,0x27 ); +MUX_ENUM_CTRL_DECL_186 (t186_mixer19_tx,0x28 ); +MUX_ENUM_CTRL_DECL_186 (t186_mixer110_tx,0x29 );/* * The number of entries in, and order of, this array is closely tied to the
@@ -333,6 +645,47 @@ static const struct snd_soc_dapm_widget tegra210_ahub_widgets[] = {TX_WIDGETS ("DMIC1" ),TX_WIDGETS ("DMIC2" ),TX_WIDGETS ("DMIC3" ), +WIDGETS ("SFC1" , t210_sfc1_tx), +WIDGETS ("SFC2" , t210_sfc2_tx), +WIDGETS ("SFC3" , t210_sfc3_tx), +WIDGETS ("SFC4" , t210_sfc4_tx), +WIDGETS ("MVC1" , t210_mvc1_tx), +WIDGETS ("MVC2" , t210_mvc2_tx), +WIDGETS ("AMX1 RX1" , t210_amx11_tx), +WIDGETS ("AMX1 RX2" , t210_amx12_tx), +WIDGETS ("AMX1 RX3" , t210_amx13_tx), +WIDGETS ("AMX1 RX4" , t210_amx14_tx), +WIDGETS ("AMX2 RX1" , t210_amx21_tx), +WIDGETS ("AMX2 RX2" , t210_amx22_tx), +WIDGETS ("AMX2 RX3" , t210_amx23_tx), +WIDGETS ("AMX2 RX4" , t210_amx24_tx), +TX_WIDGETS ("AMX1" ), +TX_WIDGETS ("AMX2" ), +WIDGETS ("ADX1" , t210_adx1_tx), +WIDGETS ("ADX2" , t210_adx2_tx), +TX_WIDGETS ("ADX1 TX1" ), +TX_WIDGETS ("ADX1 TX2" ), +TX_WIDGETS ("ADX1 TX3" ), +TX_WIDGETS ("ADX1 TX4" ), +TX_WIDGETS ("ADX2 TX1" ), +TX_WIDGETS ("ADX2 TX2" ), +TX_WIDGETS ("ADX2 TX3" ), +TX_WIDGETS ("ADX2 TX4" ), +WIDGETS ("MIXER RX1" , t210_mixer11_tx), +WIDGETS ("MIXER RX2" , t210_mixer12_tx), +WIDGETS ("MIXER RX3" , t210_mixer13_tx), +WIDGETS ("MIXER RX4" , t210_mixer14_tx), +WIDGETS ("MIXER RX5" , t210_mixer15_tx), +WIDGETS ("MIXER RX6" , t210_mixer16_tx), +WIDGETS ("MIXER RX7" , t210_mixer17_tx), +WIDGETS ("MIXER RX8" , t210_mixer18_tx), +WIDGETS ("MIXER RX9" , t210_mixer19_tx), +WIDGETS ("MIXER RX10" , t210_mixer110_tx), +TX_WIDGETS ("MIXER TX1" ), +TX_WIDGETS ("MIXER TX2" ), +TX_WIDGETS ("MIXER TX3" ), +TX_WIDGETS ("MIXER TX4" ), + TX_WIDGETS("MIXER TX5"), }; static const struct snd_soc_dapm_widget tegra186_ahub_widgets[] = {
@@ -368,6 +721,67 @@ static const struct snd_soc_dapm_widget tegra186_ahub_widgets[] = {TX_WIDGETS ("DMIC4" ),WIDGETS ("DSPK1" , t186_dspk1_tx),WIDGETS ("DSPK2" , t186_dspk2_tx), +WIDGETS ("SFC1" , t186_sfc1_tx), +WIDGETS ("SFC2" , t186_sfc2_tx), +WIDGETS ("SFC3" , t186_sfc3_tx), +WIDGETS ("SFC4" , t186_sfc4_tx), +WIDGETS ("MVC1" , t186_mvc1_tx), +WIDGETS ("MVC2" , t186_mvc2_tx), +WIDGETS ("AMX1 RX1" , t186_amx11_tx), +WIDGETS ("AMX1 RX2" , t186_amx12_tx), +WIDGETS ("AMX1 RX3" , t186_amx13_tx), +WIDGETS ("AMX1 RX4" , t186_amx14_tx), +WIDGETS ("AMX2 RX1" , t186_amx21_tx), +WIDGETS ("AMX2 RX2" , t186_amx22_tx), +WIDGETS ("AMX2 RX3" , t186_amx23_tx), +WIDGETS ("AMX2 RX4" , t186_amx24_tx), +WIDGETS ("AMX3 RX1" , t186_amx31_tx), +WIDGETS ("AMX3 RX2" , t186_amx32_tx), +WIDGETS ("AMX3 RX3" , t186_amx33_tx), +WIDGETS ("AMX3 RX4" , t186_amx34_tx), +WIDGETS ("AMX4 RX1" , t186_amx41_tx), +WIDGETS ("AMX4 RX2" , t186_amx42_tx), +WIDGETS ("AMX4 RX3" , t186_amx43_tx), +WIDGETS ("AMX4 RX4" , t186_amx44_tx), +TX_WIDGETS ("AMX1" ), +TX_WIDGETS ("AMX2" ), +TX_WIDGETS ("AMX3" ), +TX_WIDGETS ("AMX4" ), +WIDGETS ("ADX1" , t186_adx1_tx), +WIDGETS ("ADX2" , t186_adx2_tx), +WIDGETS ("ADX3" , t186_adx3_tx), +WIDGETS ("ADX4" , t186_adx4_tx), +TX_WIDGETS ("ADX1 TX1" ), +TX_WIDGETS ("ADX1 TX2" ), +TX_WIDGETS ("ADX1 TX3" ), +TX_WIDGETS ("ADX1 TX4" ), +TX_WIDGETS ("ADX2 TX1" ), +TX_WIDGETS ("ADX2 TX2" ), +TX_WIDGETS ("ADX2 TX3" ), +TX_WIDGETS ("ADX2 TX4" ), +TX_WIDGETS ("ADX3 TX1" ), +TX_WIDGETS ("ADX3 TX2" ), +TX_WIDGETS ("ADX3 TX3" ), +TX_WIDGETS ("ADX3 TX4" ), +TX_WIDGETS ("ADX4 TX1" ), +TX_WIDGETS ("ADX4 TX2" ), +TX_WIDGETS ("ADX4 TX3" ), +TX_WIDGETS ("ADX4 TX4" ), +WIDGETS ("MIXER RX1" , t186_mixer11_tx), +WIDGETS ("MIXER RX2" , t186_mixer12_tx), +WIDGETS ("MIXER RX3" , t186_mixer13_tx), +WIDGETS ("MIXER RX4" , t186_mixer14_tx), +WIDGETS ("MIXER RX5" , t186_mixer15_tx), +WIDGETS ("MIXER RX6" , t186_mixer16_tx), +WIDGETS ("MIXER RX7" , t186_mixer17_tx), +WIDGETS ("MIXER RX8" , t186_mixer18_tx), +WIDGETS ("MIXER RX9" , t186_mixer19_tx), +WIDGETS ("MIXER RX10" , t186_mixer110_tx), +TX_WIDGETS ("MIXER TX1" ), +TX_WIDGETS ("MIXER TX2" ), +TX_WIDGETS ("MIXER TX3" ), +TX_WIDGETS ("MIXER TX4" ), + TX_WIDGETS("MIXER TX5"), };#define TEGRA_COMMON_MUX_ROUTES (name) \
@@ -389,7 +803,28 @@ static const struct snd_soc_dapm_widget tegra186_ahub_widgets[] = { { name " Mux", "I2S5", "I2S5 XBAR-RX" }, \ { name " Mux", "DMIC1", "DMIC1 XBAR-RX" }, \ { name " Mux", "DMIC2", "DMIC2 XBAR-RX" }, \ - { name " Mux", "DMIC3", "DMIC3 XBAR-RX" }, + { name " Mux", "DMIC3", "DMIC3 XBAR-RX" }, \ + { name " Mux", "SFC1", "SFC1 XBAR-RX" }, \ + { name " Mux", "SFC2", "SFC2 XBAR-RX" }, \ + { name " Mux", "SFC3", "SFC3 XBAR-RX" }, \ + { name " Mux", "SFC4", "SFC4 XBAR-RX" }, \ + { name " Mux", "MVC1", "MVC1 XBAR-RX" }, \ + { name " Mux", "MVC2", "MVC2 XBAR-RX" }, \ + { name " Mux", "AMX1", "AMX1 XBAR-RX" }, \ + { name " Mux", "AMX2", "AMX2 XBAR-RX" }, \ + { name " Mux", "ADX1 TX1", "ADX1 TX1 XBAR-RX" }, \ + { name " Mux", "ADX1 TX2", "ADX1 TX2 XBAR-RX" }, \ + { name " Mux", "ADX1 TX3", "ADX1 TX3 XBAR-RX" }, \ + { name " Mux", "ADX1 TX4", "ADX1 TX4 XBAR-RX" }, \ + { name " Mux", "ADX2 TX1", "ADX2 TX1 XBAR-RX" }, \ + { name " Mux", "ADX2 TX2", "ADX2 TX2 XBAR-RX" }, \ + { name " Mux", "ADX2 TX3", "ADX2 TX3 XBAR-RX" }, \ + { name " Mux", "ADX2 TX4", "ADX2 TX4 XBAR-RX" }, \ + { name " Mux", "MIXER TX1", "MIXER TX1 XBAR-RX" }, \ + { name " Mux", "MIXER TX2", "MIXER TX2 XBAR-RX" }, \ + { name " Mux", "MIXER TX3", "MIXER TX3 XBAR-RX" }, \ + { name " Mux", "MIXER TX4", "MIXER TX4 XBAR-RX" }, \ + { name " Mux", "MIXER TX5", "MIXER TX5 XBAR-RX" }, #define TEGRA186_ONLY_MUX_ROUTES(name) \ { name " Mux", "ADMAIF11", "ADMAIF11 XBAR-RX" }, \
@@ -403,7 +838,17 @@ static const struct snd_soc_dapm_widget tegra186_ahub_widgets[] = { { name " Mux", "ADMAIF19", "ADMAIF19 XBAR-RX" }, \ { name " Mux", "ADMAIF20", "ADMAIF20 XBAR-RX" }, \ { name " Mux", "I2S6", "I2S6 XBAR-RX" }, \ - { name " Mux", "DMIC4", "DMIC4 XBAR-RX" }, + { name " Mux", "DMIC4", "DMIC4 XBAR-RX" }, \ + { name " Mux", "AMX3", "AMX3 XBAR-RX" }, \ + { name " Mux", "AMX4", "AMX4 XBAR-RX" }, \ + { name " Mux", "ADX3 TX1", "ADX3 TX1 XBAR-RX" }, \ + { name " Mux", "ADX3 TX2", "ADX3 TX2 XBAR-RX" }, \ + { name " Mux", "ADX3 TX3", "ADX3 TX3 XBAR-RX" }, \ + { name " Mux", "ADX3 TX4", "ADX3 TX4 XBAR-RX" }, \ + { name " Mux", "ADX4 TX1", "ADX4 TX1 XBAR-RX" }, \ + { name " Mux", "ADX4 TX2", "ADX4 TX2 XBAR-RX" }, \ + { name " Mux", "ADX4 TX3", "ADX4 TX3 XBAR-RX" }, \ + { name " Mux", "ADX4 TX4", "ADX4 TX4 XBAR-RX" }, #define TEGRA210_MUX_ROUTES(name) \TEGRA_COMMON_MUX_ROUTES (name)
@@ -450,6 +895,32 @@ static const struct snd_soc_dapm_route tegra210_ahub_routes[] = { TEGRA210_MUX_ROUTES("I2S3") TEGRA210_MUX_ROUTES("I2S4") TEGRA210_MUX_ROUTES("I2S5") + TEGRA210_MUX_ROUTES("SFC1") + TEGRA210_MUX_ROUTES("SFC2") + TEGRA210_MUX_ROUTES("SFC3") + TEGRA210_MUX_ROUTES("SFC4") + TEGRA210_MUX_ROUTES("MVC1") + TEGRA210_MUX_ROUTES("MVC2") + TEGRA210_MUX_ROUTES("AMX1 RX1") + TEGRA210_MUX_ROUTES("AMX1 RX2") + TEGRA210_MUX_ROUTES("AMX1 RX3") + TEGRA210_MUX_ROUTES("AMX1 RX4") + TEGRA210_MUX_ROUTES("AMX2 RX1") + TEGRA210_MUX_ROUTES("AMX2 RX2") + TEGRA210_MUX_ROUTES("AMX2 RX3") + TEGRA210_MUX_ROUTES("AMX2 RX4") + TEGRA210_MUX_ROUTES("ADX1") + TEGRA210_MUX_ROUTES("ADX2") + TEGRA210_MUX_ROUTES("MIXER RX1") + TEGRA210_MUX_ROUTES("MIXER RX2") + TEGRA210_MUX_ROUTES("MIXER RX3") + TEGRA210_MUX_ROUTES("MIXER RX4") + TEGRA210_MUX_ROUTES("MIXER RX5") + TEGRA210_MUX_ROUTES("MIXER RX6") + TEGRA210_MUX_ROUTES("MIXER RX7") + TEGRA210_MUX_ROUTES("MIXER RX8") + TEGRA210_MUX_ROUTES("MIXER RX9") +TEGRA210_MUX_ROUTES ("MIXER RX10" ) };static const struct snd_soc_dapm_route tegra186_ahub_routes[] = {
@@ -501,6 +972,42 @@ static const struct snd_soc_dapm_route tegra186_ahub_routes[] = { TEGRA186_MUX_ROUTES("I2S6") TEGRA186_MUX_ROUTES("DSPK1") TEGRA186_MUX_ROUTES("DSPK2") + TEGRA186_MUX_ROUTES("SFC1") + TEGRA186_MUX_ROUTES("SFC2") + TEGRA186_MUX_ROUTES("SFC3") + TEGRA186_MUX_ROUTES("SFC4") + TEGRA186_MUX_ROUTES("MVC1") + TEGRA186_MUX_ROUTES("MVC2") + TEGRA186_MUX_ROUTES("AMX1 RX1") + TEGRA186_MUX_ROUTES("AMX1 RX2") + TEGRA186_MUX_ROUTES("AMX1 RX3") + TEGRA186_MUX_ROUTES("AMX1 RX4") + TEGRA186_MUX_ROUTES("AMX2 RX1") + TEGRA186_MUX_ROUTES("AMX2 RX2") + TEGRA186_MUX_ROUTES("AMX2 RX3") + TEGRA186_MUX_ROUTES("AMX2 RX4") + TEGRA186_MUX_ROUTES("AMX3 RX1") + TEGRA186_MUX_ROUTES("AMX3 RX2") + TEGRA186_MUX_ROUTES("AMX3 RX3") + TEGRA186_MUX_ROUTES("AMX3 RX4") + TEGRA186_MUX_ROUTES("AMX4 RX1") + TEGRA186_MUX_ROUTES("AMX4 RX2") + TEGRA186_MUX_ROUTES("AMX4 RX3") + TEGRA186_MUX_ROUTES("AMX4 RX4") + TEGRA186_MUX_ROUTES("ADX1") + TEGRA186_MUX_ROUTES("ADX2") + TEGRA186_MUX_ROUTES("ADX3") + TEGRA186_MUX_ROUTES("ADX4") + TEGRA186_MUX_ROUTES("MIXER RX1") + TEGRA186_MUX_ROUTES("MIXER RX2") + TEGRA186_MUX_ROUTES("MIXER RX3") + TEGRA186_MUX_ROUTES("MIXER RX4") + TEGRA186_MUX_ROUTES("MIXER RX5") + TEGRA186_MUX_ROUTES("MIXER RX6") + TEGRA186_MUX_ROUTES("MIXER RX7") + TEGRA186_MUX_ROUTES("MIXER RX8") + TEGRA186_MUX_ROUTES("MIXER RX9") +TEGRA186_MUX_ROUTES ("MIXER RX10" ) };static const struct snd_soc_component_driver tegra210_ahub_component = {
Signature · 1 line
2.7.4
PATCH 6/13 ASoC: tegra: Add Tegra210 based MVC driver
In reply to Sameer PujarThe Master Volume Control (MVC) provides gain or attenuation to a digital signal path. It can be used in input or output signal path for per-stream volume control or it can be used as master volume control. The MVC block has one input and one output. The input digital stream can be mono or multi-channel (up to 7.1 channels) stream. An independent mute control is also included in the MVC block.
This patch registers MVC driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes MVC interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow build the driver. It can be enabled in the DT via "nvidia,tegra210-mvc" compatible binding.
--- sound/soc/tegra/Kconfig | 9 + sound/soc/tegra/Makefile | 2 + sound/soc/tegra/tegra210_mvc.c | 629 +++++++++++++++++++++++++++++++++++++++++ sound/soc/tegra/tegra210_mvc.h | 117 ++++++++ 4 files changed, 757 insertions(+) create mode 100644 sound/soc/tegra/tegra210_mvc.c create mode 100644 sound/soc/tegra/tegra210_mvc.h
sound/soc/tegra/Kconfig +9 -0
@@ -108,6 +108,15 @@ config SND_SOC_TEGRA210_ADMAIF channel. Buffer size is configurable for each ADMAIIF channel. Say Y or M if you want to add support for Tegra210 ADMAIF module. +config SND_SOC_TEGRA210_MVC + tristate "Tegra210 MVC module" + help + Config to enable the digital Master Volume Controller (MVC) which + provides gain or attenuation to a digital signal path. It can be + used in input or output signal path. It can be used either for + per-stream volume control or for master volume control. + Say Y or M if you want to add support for Tegra210 MVC module. + config SND_SOC_TEGRA_AUDIO_GRAPH_CARD tristate "Audio Graph Card based Tegra driver" depends on SND_AUDIO_GRAPH_CARD
sound/soc/tegra/Makefile +2 -0
@@ -13,6 +13,7 @@ snd-soc-tegra210-dmic-objs := tegra210_dmic.o snd-soc-tegra210-i2s-objs := tegra210_i2s.o snd-soc-tegra186-dspk-objs := tegra186_dspk.o snd-soc-tegra210-admaif-objs := tegra210_admaif.o +snd-soc-tegra210-mvc-objs := tegra210_mvc.o obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-pcm.o obj-$(CONFIG_SND_SOC_TEGRA20_AC97) += snd-soc-tegra20-ac97.o
@@ -26,6 +27,7 @@ obj-$(CONFIG_SND_SOC_TEGRA210_AHUB) += snd-soc-tegra210-ahub.o obj-$(CONFIG_SND_SOC_TEGRA210_I2S) += snd-soc-tegra210-i2s.o obj-$(CONFIG_SND_SOC_TEGRA186_DSPK) += snd-soc-tegra186-dspk.o obj-$(CONFIG_SND_SOC_TEGRA210_ADMAIF) += snd-soc-tegra210-admaif.o +obj-$(CONFIG_SND_SOC_TEGRA210_MVC) += snd-soc-tegra210-mvc.o # Tegra machine Support snd-soc-tegra-wm8903-objs := tegra_wm8903.o
sound/soc/tegra/tegra210_mvc.c new file +629 -0
629 lines not on this page · raw message
sound/soc/tegra/tegra210_mvc.h new file +117 -0
117 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 8/13 ASoC: tegra: Add Tegra210 based AMX driver
In reply to Sameer PujarThe Audio Multiplexer (AMX) block can multiplex up to four input streams each of which can have maximum 16 channels and generate an output stream with maximum 16 channels. A byte RAM helps to form an output frame by any combination of bytes from the input frames.
This patch registers AMX driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes AMX interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow build the driver. It can be enabled in the DT via "nvidia,tegra210-amx" for Tegra210 and Tegra186. For Tegra194 and later, "nvidia,tegra194-amx" can be used.
--- sound/soc/tegra/Kconfig | 9 + sound/soc/tegra/Makefile | 2 + sound/soc/tegra/tegra210_amx.c | 595 +++++++++++++++++++++++++++++++++++++++++ sound/soc/tegra/tegra210_amx.h | 93 +++++++ 4 files changed, 699 insertions(+) create mode 100644 sound/soc/tegra/tegra210_amx.c create mode 100644 sound/soc/tegra/tegra210_amx.h
sound/soc/tegra/Kconfig +9 -0
@@ -126,6 +126,15 @@ config SND_SOC_TEGRA210_SFC upto 2 channels (stereo). Say Y or M if you want to add support for Tegra210 SFC module. +config SND_SOC_TEGRA210_AMX + tristate "Tegra210 AMX module" + help + Config to enable the Audio Multiplexer (AMX) which can multiplex + four input streams (each of up to 16 channels) and generate + output stream (of up to 16 channels). A byte RAM helps to form an + output frame by any combination of bytes from the input frames. + Say Y or M if you want to add support for Tegra210 AMX module. + config SND_SOC_TEGRA_AUDIO_GRAPH_CARD tristate "Audio Graph Card based Tegra driver" depends on SND_AUDIO_GRAPH_CARD
sound/soc/tegra/Makefile +2 -0
@@ -15,6 +15,7 @@ snd-soc-tegra186-dspk-objs := tegra186_dspk.o snd-soc-tegra210-admaif-objs := tegra210_admaif.o snd-soc-tegra210-mvc-objs := tegra210_mvc.o snd-soc-tegra210-sfc-objs := tegra210_sfc.o +snd-soc-tegra210-amx-objs := tegra210_amx.o obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-pcm.o obj-$(CONFIG_SND_SOC_TEGRA20_AC97) += snd-soc-tegra20-ac97.o
@@ -30,6 +31,7 @@ obj-$(CONFIG_SND_SOC_TEGRA186_DSPK) += snd-soc-tegra186-dspk.o obj-$(CONFIG_SND_SOC_TEGRA210_ADMAIF) += snd-soc-tegra210-admaif.o obj-$(CONFIG_SND_SOC_TEGRA210_MVC) += snd-soc-tegra210-mvc.o obj-$(CONFIG_SND_SOC_TEGRA210_SFC) += snd-soc-tegra210-sfc.o +obj-$(CONFIG_SND_SOC_TEGRA210_AMX) += snd-soc-tegra210-amx.o # Tegra machine Support snd-soc-tegra-wm8903-objs := tegra_wm8903.o
sound/soc/tegra/tegra210_amx.c new file +595 -0
595 lines not on this page · raw message
sound/soc/tegra/tegra210_amx.h new file +93 -0
93 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 7/13 ASoC: tegra: Add Tegra210 based SFC driver
In reply to Sameer PujarThe Sampling Frequency Converter (SFC) converts the sampling frequency of the input signal from one frequency to another. It supports sampling frequency conversions of streams of up to two channels (stereo).
This patch registers SFC driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes SFC interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow build the driver. It can be enabled in the DT via "nvidia,tegra210-sfc" compatible binding.
--- sound/soc/tegra/Kconfig | 9 + sound/soc/tegra/Makefile | 2 + sound/soc/tegra/tegra210_sfc.c | 3542 ++++++++++++++++++++++++++++++++++++++++ sound/soc/tegra/tegra210_sfc.h | 78 + 4 files changed, 3631 insertions(+) create mode 100644 sound/soc/tegra/tegra210_sfc.c create mode 100644 sound/soc/tegra/tegra210_sfc.h
sound/soc/tegra/Kconfig +9 -0
@@ -117,6 +117,15 @@ config SND_SOC_TEGRA210_MVC per-stream volume control or for master volume control. Say Y or M if you want to add support for Tegra210 MVC module. +config SND_SOC_TEGRA210_SFC + tristate "Tegra210 SFC module" + help + Config to enable the Sampling Frequency Converter (SFC) which + converts the sampling frequency of input signal to another + frequency. It supports sampling frequency conversion of streams + upto 2 channels (stereo). + Say Y or M if you want to add support for Tegra210 SFC module. + config SND_SOC_TEGRA_AUDIO_GRAPH_CARD tristate "Audio Graph Card based Tegra driver" depends on SND_AUDIO_GRAPH_CARD
sound/soc/tegra/Makefile +2 -0
@@ -14,6 +14,7 @@ snd-soc-tegra210-i2s-objs := tegra210_i2s.o snd-soc-tegra186-dspk-objs := tegra186_dspk.o snd-soc-tegra210-admaif-objs := tegra210_admaif.o snd-soc-tegra210-mvc-objs := tegra210_mvc.o +snd-soc-tegra210-sfc-objs := tegra210_sfc.o obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-pcm.o obj-$(CONFIG_SND_SOC_TEGRA20_AC97) += snd-soc-tegra20-ac97.o
@@ -28,6 +29,7 @@ obj-$(CONFIG_SND_SOC_TEGRA210_I2S) += snd-soc-tegra210-i2s.o obj-$(CONFIG_SND_SOC_TEGRA186_DSPK) += snd-soc-tegra186-dspk.o obj-$(CONFIG_SND_SOC_TEGRA210_ADMAIF) += snd-soc-tegra210-admaif.o obj-$(CONFIG_SND_SOC_TEGRA210_MVC) += snd-soc-tegra210-mvc.o +obj-$(CONFIG_SND_SOC_TEGRA210_SFC) += snd-soc-tegra210-sfc.o # Tegra machine Support snd-soc-tegra-wm8903-objs := tegra_wm8903.o
sound/soc/tegra/tegra210_sfc.c new file +3542 -0
2,971 lines not on this page · raw message
sound/soc/tegra/tegra210_sfc.h new file +78 -0
78 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.7.4
Part of the diff is not shown here. View the raw message.
PATCH 9/13 ASoC: tegra: Add Tegra210 based ADX driver
In reply to Sameer PujarThe Audio Demultiplexer (ADX) block takes an input stream with up to 16 channels and demultiplexes it into four output streams of up to 16 channels each. A byte RAM helps to form output frames by any combination of bytes from the input frame. Its design is identical to that of byte RAM in the AMX except that the data flow direction is reversed.
This patch registers ADX driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes ADX interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow build the driver. It can be enabled in the DT via "nvidia,tegra210-adx" compatible binding.
--- sound/soc/tegra/Kconfig | 11 + sound/soc/tegra/Makefile | 2 + sound/soc/tegra/tegra210_adx.c | 527 +++++++++++++++++++++++++++++++++++++++++ sound/soc/tegra/tegra210_adx.h | 72 ++++++ 4 files changed, 612 insertions(+) create mode 100644 sound/soc/tegra/tegra210_adx.c create mode 100644 sound/soc/tegra/tegra210_adx.h
sound/soc/tegra/Kconfig +11 -0
@@ -135,6 +135,17 @@ config SND_SOC_TEGRA210_AMX output frame by any combination of bytes from the input frames. Say Y or M if you want to add support for Tegra210 AMX module. +config SND_SOC_TEGRA210_ADX + tristate "Tegra210 ADX module" + help + Config to enable the Audio Demultiplexer (ADX) which takes an + input stream (up to 16 channels) and demultiplexes it into four + output streams (each of up to 16 channels). A byte RAM helps to + form output frames by any combination of bytes from the input + frame. Its design is identical to that of byte RAM in the AMX + except that the data flow direction is reversed. + Say Y or M if you want to add support for Tegra210 ADX module. + config SND_SOC_TEGRA_AUDIO_GRAPH_CARD tristate "Audio Graph Card based Tegra driver" depends on SND_AUDIO_GRAPH_CARD
sound/soc/tegra/Makefile +2 -0
@@ -16,6 +16,7 @@ snd-soc-tegra210-admaif-objs := tegra210_admaif.o snd-soc-tegra210-mvc-objs := tegra210_mvc.o snd-soc-tegra210-sfc-objs := tegra210_sfc.o snd-soc-tegra210-amx-objs := tegra210_amx.o +snd-soc-tegra210-adx-objs := tegra210_adx.o obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-pcm.o obj-$(CONFIG_SND_SOC_TEGRA20_AC97) += snd-soc-tegra20-ac97.o
@@ -32,6 +33,7 @@ obj-$(CONFIG_SND_SOC_TEGRA210_ADMAIF) += snd-soc-tegra210-admaif.o obj-$(CONFIG_SND_SOC_TEGRA210_MVC) += snd-soc-tegra210-mvc.o obj-$(CONFIG_SND_SOC_TEGRA210_SFC) += snd-soc-tegra210-sfc.o obj-$(CONFIG_SND_SOC_TEGRA210_AMX) += snd-soc-tegra210-amx.o +obj-$(CONFIG_SND_SOC_TEGRA210_ADX) += snd-soc-tegra210-adx.o # Tegra machine Support snd-soc-tegra-wm8903-objs := tegra_wm8903.o
sound/soc/tegra/tegra210_adx.c new file +527 -0
527 lines not on this page · raw message
sound/soc/tegra/tegra210_adx.h new file +72 -0
72 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 10/13 ASoC: tegra: Add Tegra210 based Mixer driver
In reply to Sameer PujarThe Mixer supports mixing of up to ten 7.1 audio input streams and generate five outputs (each of which can be any combination of the ten input streams)
This patch registers Mixer driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes Mixer interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow build the driver. It can be enabled in the DT via "nvidia,tegra210-amixer" compatible binding.
--- sound/soc/tegra/Kconfig | 10 + sound/soc/tegra/Makefile | 2 + sound/soc/tegra/tegra210_mixer.c | 667 +++++++++++++++++++++++++++++++++++++++ sound/soc/tegra/tegra210_mixer.h | 100 ++++++ 4 files changed, 779 insertions(+) create mode 100644 sound/soc/tegra/tegra210_mixer.c create mode 100644 sound/soc/tegra/tegra210_mixer.h
sound/soc/tegra/Kconfig +10 -0
@@ -146,6 +146,16 @@ config SND_SOC_TEGRA210_ADX except that the data flow direction is reversed. Say Y or M if you want to add support for Tegra210 ADX module. +config SND_SOC_TEGRA210_MIXER + tristate "Tegra210 Mixer module" + help + Config to enable the Mixer module which can help to mix multiple + audio streams. It supports mixing of upto 10 input streams, + where each stream can contain maximum of 8 channels. It supports + 5 output each of which can be a mix of any combination of 10 + input streams. + Say Y or M if you want to add support for Tegra210 Mixer module. + config SND_SOC_TEGRA_AUDIO_GRAPH_CARD tristate "Audio Graph Card based Tegra driver" depends on SND_AUDIO_GRAPH_CARD
sound/soc/tegra/Makefile +2 -0
@@ -17,6 +17,7 @@ snd-soc-tegra210-mvc-objs := tegra210_mvc.o snd-soc-tegra210-sfc-objs := tegra210_sfc.o snd-soc-tegra210-amx-objs := tegra210_amx.o snd-soc-tegra210-adx-objs := tegra210_adx.o +snd-soc-tegra210-mixer-objs := tegra210_mixer.o obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-pcm.o obj-$(CONFIG_SND_SOC_TEGRA20_AC97) += snd-soc-tegra20-ac97.o
@@ -34,6 +35,7 @@ obj-$(CONFIG_SND_SOC_TEGRA210_MVC) += snd-soc-tegra210-mvc.o obj-$(CONFIG_SND_SOC_TEGRA210_SFC) += snd-soc-tegra210-sfc.o obj-$(CONFIG_SND_SOC_TEGRA210_AMX) += snd-soc-tegra210-amx.o obj-$(CONFIG_SND_SOC_TEGRA210_ADX) += snd-soc-tegra210-adx.o +obj-$(CONFIG_SND_SOC_TEGRA210_MIXER) += snd-soc-tegra210-mixer.o # Tegra machine Support snd-soc-tegra-wm8903-objs := tegra_wm8903.o
sound/soc/tegra/tegra210_mixer.c new file +667 -0
667 lines not on this page · raw message
sound/soc/tegra/tegra210_mixer.h new file +100 -0
100 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 11/13 arm64: defconfig: Enable few Tegra210 based AHUB drivers
In reply to Sameer PujarEnable configs for following modules:
* SFC (Sampling Frequency Converter)
* MVC (Master Volume Control)
* AMX (Audio Multiplexer)
* ADX (Audio Demultiplexer)
* Mixer
These configs are used on Tegra186 and later SoCs as well.
--- arch/arm64/configs/defconfig | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm64/configs/defconfig +5 -0
@@ -773,6 +773,11 @@ CONFIG_SND_SOC_TEGRA210_DMIC=m CONFIG_SND_SOC_TEGRA210_I2S=m CONFIG_SND_SOC_TEGRA186_DSPK=m CONFIG_SND_SOC_TEGRA210_ADMAIF=m +CONFIG_SND_SOC_TEGRA210_MVC=m +CONFIG_SND_SOC_TEGRA210_SFC=m +CONFIG_SND_SOC_TEGRA210_AMX=m +CONFIG_SND_SOC_TEGRA210_ADX=m +CONFIG_SND_SOC_TEGRA210_MIXER=m CONFIG_SND_SOC_TEGRA_AUDIO_GRAPH_CARD=m CONFIG_SND_SOC_AK4613=m CONFIG_SND_SOC_ES7134=m
Signature · 1 line
2.7.4
PATCH 12/13 arm64: tegra: Add few AHUB devices for Tegra210 and later
In reply to Sameer PujarAdd DT nodes for following AHUB devices:
* SFC (Sampling Frequency Converter)
* MVC (Master Volume Control)
* AMX (Audio Multiplexer)
* ADX (Audio Demultiplexer)
* Mixer
Above devices are added for Tegra210, Tegra186 and Tegra194 generations of Tegra SoC.
--- arch/arm64/boot/dts/nvidia/tegra186.dtsi | 120 +++++++++++++++++++++++++++++++ arch/arm64/boot/dts/nvidia/tegra194.dtsi | 116 ++++++++++++++++++++++++++++++ arch/arm64/boot/dts/nvidia/tegra210.dtsi | 77 ++++++++++++++++++++ 3 files changed, 313 insertions(+)
arch/arm64/boot/dts/nvidia/tegra186.dtsi +120 -0
@@ -354,6 +354,126 @@ sound-name-prefix = "DSPK2"; status = "disabled"; }; + + tegra_sfc1: sfc@2902000 { + compatible = "nvidia,tegra186-sfc", + "nvidia,tegra210-sfc"; + reg = <0x2902000 0x200>; + sound-name-prefix = "SFC1"; + status = "disabled"; + }; + + tegra_sfc2: sfc@2902200 { + compatible = "nvidia,tegra186-sfc", + "nvidia,tegra210-sfc"; + reg = <0x2902200 0x200>; + sound-name-prefix = "SFC2"; + status = "disabled"; + }; + + tegra_sfc3: sfc@2902400 { + compatible = "nvidia,tegra186-sfc", + "nvidia,tegra210-sfc"; + reg = <0x2902400 0x200>; + sound-name-prefix = "SFC3"; + status = "disabled"; + }; + + tegra_sfc4: sfc@2902600 { + compatible = "nvidia,tegra186-sfc", + "nvidia,tegra210-sfc"; + reg = <0x2902600 0x200>; + sound-name-prefix = "SFC4"; + status = "disabled"; + }; + + tegra_mvc1: mvc@290a000 { + compatible = "nvidia,tegra186-mvc", + "nvidia,tegra210-mvc"; + reg = <0x290a000 0x200>; + sound-name-prefix = "MVC1"; + status = "disabled"; + }; + + tegra_mvc2: mvc@290a200 { + compatible = "nvidia,tegra186-mvc", + "nvidia,tegra210-mvc"; + reg = <0x290a200 0x200>; + sound-name-prefix = "MVC2"; + status = "disabled"; + }; + + tegra_amx1: amx@2903000 { + compatible = "nvidia,tegra186-amx", + "nvidia,tegra210-amx"; + reg = <0x2903000 0x100>; + sound-name-prefix = "AMX1"; + status = "disabled"; + }; + + tegra_amx2: amx@2903100 { + compatible = "nvidia,tegra186-amx", + "nvidia,tegra210-amx"; + reg = <0x2903100 0x100>; + sound-name-prefix = "AMX2"; + status = "disabled"; + }; + + tegra_amx3: amx@2903200 { + compatible = "nvidia,tegra186-amx", + "nvidia,tegra210-amx"; + reg = <0x2903200 0x100>; + sound-name-prefix = "AMX3"; + status = "disabled"; + }; + + tegra_amx4: amx@2903300 { + compatible = "nvidia,tegra186-amx", + "nvidia,tegra210-amx"; + reg = <0x2903300 0x100>; + sound-name-prefix = "AMX4"; + status = "disabled"; + }; + + tegra_adx1: adx@2903800 { + compatible = "nvidia,tegra186-adx", + "nvidia,tegra210-adx"; + reg = <0x2903800 0x100>; + sound-name-prefix = "ADX1"; + status = "disabled"; + }; + + tegra_adx2: adx@2903900 { + compatible = "nvidia,tegra186-adx", + "nvidia,tegra210-adx"; + reg = <0x2903900 0x100>; + sound-name-prefix = "ADX2"; + status = "disabled"; + }; + + tegra_adx3: adx@2903a00 { + compatible = "nvidia,tegra186-adx", + "nvidia,tegra210-adx"; + reg = <0x2903a00 0x100>; + sound-name-prefix = "ADX3"; + status = "disabled"; + }; + + tegra_adx4: adx@2903b00 { + compatible = "nvidia,tegra186-adx", + "nvidia,tegra210-adx"; + reg = <0x2903b00 0x100>; + sound-name-prefix = "ADX4"; + status = "disabled"; + }; + + tegra_amixer: amixer@290bb00 { + compatible = "nvidia,tegra186-amixer", + "nvidia,tegra210-amixer"; + reg = <0x290bb00 0x800>; + sound-name-prefix = "MIXER"; + status = "disabled"; + }; }; };
arch/arm64/boot/dts/nvidia/tegra194.dtsi +116 -0
122 lines not on this page · raw message
arch/arm64/boot/dts/nvidia/tegra210.dtsi +77 -0
83 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 13/13 arm64: tegra: Extend APE audio support on Jetson platforms
In reply to Sameer PujarExtend APE audio support by adding more audio components such as SFC, MVC, AMX, ADX and Mixer. These components can be plugged into an audio path and required processing can be done. ASoC audio-graph based sound driver is used to facilitate this and thus extend sound bindings as well.
The components in the path may require different PCM parameters (such as sample rate, channels or sample size). Depending on the pre-defined audio paths, these can be statically configured with "convert-xxx" DT properties in endpoint subnode. The support for the rate and channel conversion is already available in generic audio-graph driver. Sample size conversion support can be added based on the need in future.
The support is extended for following platforms:
* Jertson TX1
* Jetson Nano
* Jetson TX2
* Jetson AGX Xavier
* Jetson Xavier NX
--- arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 1554 ++++++++++++++++++-- arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts | 1493 +++++++++++++++++-- .../arm64/boot/dts/nvidia/tegra194-p3509-0000.dtsi | 1520 +++++++++++++++++-- arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 876 +++++++++++ arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 876 +++++++++++ 5 files changed, 5900 insertions(+), 419 deletions(-)
arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts +1399 -155
@@ -275,178 +275,1097 @@ remote-endpoint = <&dspk2_cif_ep>; }; }; + + xbar_sfc1_in_port: port@20 { + reg = <0x20>; + + xbar_sfc1_in_ep: endpoint { + remote-endpoint = <&sfc1_cif_in_ep>; + }; + }; + + port@21 { + reg = <0x21>; + + xbar_sfc1_out_ep: endpoint { + remote-endpoint = <&sfc1_cif_out_ep>; + }; + }; + + xbar_sfc2_in_port: port@22 { + reg = <0x22>; + + xbar_sfc2_in_ep: endpoint { + remote-endpoint = <&sfc2_cif_in_ep>; + }; + }; + + port@23 { + reg = <0x23>; + + xbar_sfc2_out_ep: endpoint { + remote-endpoint = <&sfc2_cif_out_ep>; + }; + }; + + xbar_sfc3_in_port: port@24 { + reg = <0x24>; + + xbar_sfc3_in_ep: endpoint { + remote-endpoint = <&sfc3_cif_in_ep>; + }; + }; + + port@25 { + reg = <0x25>; + + xbar_sfc3_out_ep: endpoint { + remote-endpoint = <&sfc3_cif_out_ep>; + }; + }; + + xbar_sfc4_in_port: port@26 { + reg = <0x26>; + + xbar_sfc4_in_ep: endpoint { + remote-endpoint = <&sfc4_cif_in_ep>; + }; + }; + + port@27 { + reg = <0x27>; + + xbar_sfc4_out_ep: endpoint { + remote-endpoint = <&sfc4_cif_out_ep>; + }; + }; + + xbar_mvc1_in_port: port@28 { + reg = <0x28>; + + xbar_mvc1_in_ep: endpoint { + remote-endpoint = <&mvc1_cif_in_ep>; + }; + }; + + port@29 { + reg = <0x29>; + + xbar_mvc1_out_ep: endpoint { + remote-endpoint = <&mvc1_cif_out_ep>; + }; + }; + + xbar_mvc2_in_port: port@2a { + reg = <0x2a>; + + xbar_mvc2_in_ep: endpoint { + remote-endpoint = <&mvc2_cif_in_ep>; + }; + }; + + port@2b { + reg = <0x2b>; + + xbar_mvc2_out_ep: endpoint { + remote-endpoint = <&mvc2_cif_out_ep>; + }; + }; + + xbar_amx1_in1_port: port@2c { + reg = <0x2c>; + + xbar_amx1_in1_ep: endpoint { + remote-endpoint = <&amx1_in1_ep>; + }; + }; + + xbar_amx1_in2_port: port@2d { + reg = <0x2d>; + + xbar_amx1_in2_ep: endpoint { + remote-endpoint = <&amx1_in2_ep>; + }; + }; + + xbar_amx1_in3_port: port@2e { + reg = <0x2e>; + + xbar_amx1_in3_ep: endpoint { + remote-endpoint = <&amx1_in3_ep>; + }; + }; + + xbar_amx1_in4_port: port@2f { + reg = <0x2f>; + + xbar_amx1_in4_ep: endpoint { + remote-endpoint = <&amx1_in4_ep>; + }; + }; + + port@30 { + reg = <0x30>; + + xbar_amx1_out_ep: endpoint { + remote-endpoint = <&amx1_out_ep>; + }; + }; + + xbar_amx2_in1_port: port@31 { + reg = <0x31>; + + xbar_amx2_in1_ep: endpoint { + remote-endpoint = <&amx2_in1_ep>; + }; + }; + + xbar_amx2_in2_port: port@32 { + reg = <0x32>; + + xbar_amx2_in2_ep: endpoint { + remote-endpoint = <&amx2_in2_ep>; + }; + }; + + xbar_amx2_in3_port: port@33 { + reg = <0x33>; + + xbar_amx2_in3_ep: endpoint { + remote-endpoint = <&amx2_in3_ep>; + }; + }; + + xbar_amx2_in4_port: port@34 { + reg = <0x34>; + + xbar_amx2_in4_ep: endpoint { + remote-endpoint = <&amx2_in4_ep>; + }; + }; + + port@35 { + reg = <0x35>; + + xbar_amx2_out_ep: endpoint { + remote-endpoint = <&amx2_out_ep>; + }; + }; + + xbar_amx3_in1_port: port@36 { + reg = <0x36>; + + xbar_amx3_in1_ep: endpoint { + remote-endpoint = <&amx3_in1_ep>; + }; + }; + + xbar_amx3_in2_port: port@37 { + reg = <0x37>; + + xbar_amx3_in2_ep: endpoint { + remote-endpoint = <&amx3_in2_ep>; + }; + }; + + xbar_amx3_in3_port: port@38 { + reg = <0x38>; + + xbar_amx3_in3_ep: endpoint { + remote-endpoint = <&amx3_in3_ep>; + }; + }; + + xbar_amx3_in4_port: port@39 { + reg = <0x39>; + + xbar_amx3_in4_ep: endpoint { + remote-endpoint = <&amx3_in4_ep>; + }; + }; + + port@3a { + reg = <0x3a>; + + xbar_amx3_out_ep: endpoint { + remote-endpoint = <&amx3_out_ep>; + }; + }; + + xbar_amx4_in1_port: port@3b { + reg = <0x3b>; + + xbar_amx4_in1_ep: endpoint { + remote-endpoint = <&amx4_in1_ep>; + }; + }; + + xbar_amx4_in2_port: port@3c { + reg = <0x3c>; + + xbar_amx4_in2_ep: endpoint { + remote-endpoint = <&amx4_in2_ep>; + }; + }; + + xbar_amx4_in3_port: port@3d { + reg = <0x3d>; + + xbar_amx4_in3_ep: endpoint { + remote-endpoint = <&amx4_in3_ep>; + }; + }; + + xbar_amx4_in4_port: port@3e { + reg = <0x3e>; + + xbar_amx4_in4_ep: endpoint { + remote-endpoint = <&amx4_in4_ep>; + }; + }; + + port@3f { + reg = <0x3f>; + + xbar_amx4_out_ep: endpoint { + remote-endpoint = <&amx4_out_ep>; + }; + }; + + xbar_adx1_in_port: port@40 { + reg = <0x40>; + + xbar_adx1_in_ep: endpoint { + remote-endpoint = <&adx1_in_ep>; + }; + }; + + port@41 { + reg = <0x41>; + + xbar_adx1_out1_ep: endpoint { + remote-endpoint = <&adx1_out1_ep>; + }; + }; + + port@42 { + reg = <0x42>; + + xbar_adx1_out2_ep: endpoint { + remote-endpoint = <&adx1_out2_ep>; + }; + }; + + port@43 { + reg = <0x43>; + + xbar_adx1_out3_ep: endpoint { + remote-endpoint = <&adx1_out3_ep>; + }; + }; + + port@44 { + reg = <0x44>; + + xbar_adx1_out4_ep: endpoint { + remote-endpoint = <&adx1_out4_ep>; + }; + }; + + xbar_adx2_in_port: port@45 { + reg = <0x45>; + + xbar_adx2_in_ep: endpoint { + remote-endpoint = <&adx2_in_ep>; + }; + }; + + port@46 { + reg = <0x46>; + + xbar_adx2_out1_ep: endpoint { + remote-endpoint = <&adx2_out1_ep>; + }; + }; + + port@47 { + reg = <0x47>; + + xbar_adx2_out2_ep: endpoint { + remote-endpoint = <&adx2_out2_ep>; + }; + }; + + port@48 { + reg = <0x48>; + + xbar_adx2_out3_ep: endpoint { + remote-endpoint = <&adx2_out3_ep>; + }; + }; + + port@49 { + reg = <0x49>; + + xbar_adx2_out4_ep: endpoint { + remote-endpoint = <&adx2_out4_ep>; + }; + }; + + xbar_adx3_in_port: port@4a { + reg = <0x4a>; + + xbar_adx3_in_ep: endpoint { + remote-endpoint = <&adx3_in_ep>; + }; + }; + + port@4b { + reg = <0x4b>; + + xbar_adx3_out1_ep: endpoint { + remote-endpoint = <&adx3_out1_ep>; + }; + }; + + port@4c { + reg = <0x4c>; + + xbar_adx3_out2_ep: endpoint { + remote-endpoint = <&adx3_out2_ep>; + }; + }; + + port@4d { + reg = <0x4d>; + + xbar_adx3_out3_ep: endpoint { + remote-endpoint = <&adx3_out3_ep>; + }; + }; + + port@4e { + reg = <0x4e>; + + xbar_adx3_out4_ep: endpoint { + remote-endpoint = <&adx3_out4_ep>; + }; + }; + + xbar_adx4_in_port: port@4f { + reg = <0x4f>; + + xbar_adx4_in_ep: endpoint { + remote-endpoint = <&adx4_in_ep>; + }; + }; + + port@50 { + reg = <0x50>; + + xbar_adx4_out1_ep: endpoint { + remote-endpoint = <&adx4_out1_ep>; + }; + }; + + port@51 { + reg = <0x51>; + + xbar_adx4_out2_ep: endpoint { + remote-endpoint = <&adx4_out2_ep>; + }; + }; + + port@52 { + reg = <0x52>; + + xbar_adx4_out3_ep: endpoint { + remote-endpoint = <&adx4_out3_ep>; + }; + }; + + port@53 { + reg = <0x53>; + + xbar_adx4_out4_ep: endpoint { + remote-endpoint = <&adx4_out4_ep>; + }; + }; + + xbar_mixer_in1_port: port@54 { + reg = <0x54>; + + xbar_mixer_in1_ep: endpoint { + remote-endpoint = <&mixer_in1_ep>; + }; + }; + + xbar_mixer_in2_port: port@55 { + reg = <0x55>; + + xbar_mixer_in2_ep: endpoint { + remote-endpoint = <&mixer_in2_ep>; + }; + }; + + xbar_mixer_in3_port: port@56 { + reg = <0x56>; + + xbar_mixer_in3_ep: endpoint { + remote-endpoint = <&mixer_in3_ep>; + }; + }; + + xbar_mixer_in4_port: port@57 { + reg = <0x57>; + + xbar_mixer_in4_ep: endpoint { + remote-endpoint = <&mixer_in4_ep>; + }; + }; + + xbar_mixer_in5_port: port@58 { + reg = <0x58>; + + xbar_mixer_in5_ep: endpoint { + remote-endpoint = <&mixer_in5_ep>; + }; + }; + + xbar_mixer_in6_port: port@59 { + reg = <0x59>; + + xbar_mixer_in6_ep: endpoint { + remote-endpoint = <&mixer_in6_ep>; + }; + }; + + xbar_mixer_in7_port: port@5a { + reg = <0x5a>; + + xbar_mixer_in7_ep: endpoint { + remote-endpoint = <&mixer_in7_ep>; + }; + }; + + xbar_mixer_in8_port: port@5b { + reg = <0x5b>; + + xbar_mixer_in8_ep: endpoint { + remote-endpoint = <&mixer_in8_ep>; + }; + }; + + xbar_mixer_in9_port: port@5c { + reg = <0x5c>; + + xbar_mixer_in9_ep: endpoint { + remote-endpoint = <&mixer_in9_ep>; + }; + }; + + xbar_mixer_in10_port: port@5d { + reg = <0x5d>; + + xbar_mixer_in10_ep: endpoint { + remote-endpoint = <&mixer_in10_ep>; + }; + }; + + port@5e { + reg = <0x5e>; + + xbar_mixer_out1_ep: endpoint { + remote-endpoint = <&mixer_out1_ep>; + }; + }; + + port@5f { + reg = <0x5f>; + + xbar_mixer_out2_ep: endpoint { + remote-endpoint = <&mixer_out2_ep>; + }; + }; + + port@60 { + reg = <0x60>; + + xbar_mixer_out3_ep: endpoint { + remote-endpoint = <&mixer_out3_ep>; + }; + }; + + port@61 { + reg = <0x61>; + + xbar_mixer_out4_ep: endpoint { + remote-endpoint = <&mixer_out4_ep>; + }; + }; + + port@62 { + reg = <0x62>; + + xbar_mixer_out5_ep: endpoint { + remote-endpoint = <&mixer_out5_ep>; + }; + }; + }; + + admaif@290f000 { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + admaif0_port: port@0 { + reg = <0x0>; + + admaif0_ep: endpoint { + remote-endpoint = <&xbar_admaif0_ep>; + }; + }; + + admaif1_port: port@1 { + reg = <0x1>; + + admaif1_ep: endpoint { + remote-endpoint = <&xbar_admaif1_ep>; + }; + }; + + admaif2_port: port@2 { + reg = <0x2>; + + admaif2_ep: endpoint { + remote-endpoint = <&xbar_admaif2_ep>; + }; + }; + + admaif3_port: port@3 { + reg = <0x3>; + + admaif3_ep: endpoint { + remote-endpoint = <&xbar_admaif3_ep>; + }; + }; + + admaif4_port: port@4 { + reg = <0x4>; + + admaif4_ep: endpoint { + remote-endpoint = <&xbar_admaif4_ep>; + }; + }; + + admaif5_port: port@5 { + reg = <0x5>; + + admaif5_ep: endpoint { + remote-endpoint = <&xbar_admaif5_ep>; + }; + }; + + admaif6_port: port@6 { + reg = <0x6>; + + admaif6_ep: endpoint { + remote-endpoint = <&xbar_admaif6_ep>; + }; + }; + + admaif7_port: port@7 { + reg = <0x7>; + + admaif7_ep: endpoint { + remote-endpoint = <&xbar_admaif7_ep>; + }; + }; + + admaif8_port: port@8 { + reg = <0x8>; + + admaif8_ep: endpoint { + remote-endpoint = <&xbar_admaif8_ep>; + }; + }; + + admaif9_port: port@9 { + reg = <0x9>; + + admaif9_ep: endpoint { + remote-endpoint = <&xbar_admaif9_ep>; + }; + }; + + admaif10_port: port@a { + reg = <0xa>; + + admaif10_ep: endpoint { + remote-endpoint = <&xbar_admaif10_ep>; + }; + }; + + admaif11_port: port@b { + reg = <0xb>; + + admaif11_ep: endpoint { + remote-endpoint = <&xbar_admaif11_ep>; + }; + }; + + admaif12_port: port@c { + reg = <0xc>; + + admaif12_ep: endpoint { + remote-endpoint = <&xbar_admaif12_ep>; + }; + }; + + admaif13_port: port@d { + reg = <0xd>; + + admaif13_ep: endpoint { + remote-endpoint = <&xbar_admaif13_ep>; + }; + }; + + admaif14_port: port@e { + reg = <0xe>; + + admaif14_ep: endpoint { + remote-endpoint = <&xbar_admaif14_ep>; + }; + }; + + admaif15_port: port@f { + reg = <0xf>; + + admaif15_ep: endpoint { + remote-endpoint = <&xbar_admaif15_ep>; + }; + }; + + admaif16_port: port@10 { + reg = <0x10>; + + admaif16_ep: endpoint { + remote-endpoint = <&xbar_admaif16_ep>; + }; + }; + + admaif17_port: port@11 { + reg = <0x11>; + + admaif17_ep: endpoint { + remote-endpoint = <&xbar_admaif17_ep>; + }; + }; + + admaif18_port: port@12 { + reg = <0x12>; + + admaif18_ep: endpoint { + remote-endpoint = <&xbar_admaif18_ep>; + }; + }; + + admaif19_port: port@13 { + reg = <0x13>; + + admaif19_ep: endpoint { + remote-endpoint = <&xbar_admaif19_ep>; + }; + }; + }; + }; + + i2s@2901000 { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + i2s1_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s1_ep>; + }; + }; + + i2s1_port: port@1 { + reg = <1>; + + i2s1_dap_ep: endpoint { + dai-format = "i2s"; + /* Placeholder for external Codec */ + }; + }; + }; + }; + + i2s@2901100 { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + i2s2_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s2_ep>; + }; + }; + + i2s2_port: port@1 { + reg = <1>; + + i2s2_dap_ep: endpoint { + dai-format = "i2s"; + /* Placeholder for external Codec */ + }; + }; + }; + }; + + i2s@2901200 { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + i2s3_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s3_ep>; + }; + }; + + i2s3_port: port@1 { + reg = <1>; + + i2s3_dap_ep: endpoint { + dai-format = "i2s"; + /* Placeholder for external Codec */ + }; + }; + }; }; - admaif@290f000 { + i2s@2901300 { status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; - admaif0_port: port@0 { - reg = <0x0>; + port@0 { + reg = <0>; - admaif0_ep: endpoint { - remote-endpoint = <&xbar_admaif0_ep>; + i2s4_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s4_ep>; }; }; - admaif1_port: port@1 { - reg = <0x1>; + i2s4_port: port@1 { + reg = <1>; - admaif1_ep: endpoint { - remote-endpoint = <&xbar_admaif1_ep>; + i2s4_dap_ep: endpoint { + dai-format = "i2s"; + /* Placeholder for external Codec */ }; }; + }; + }; - admaif2_port: port@2 { - reg = <0x2>; + i2s@2901400 { + status = "okay"; - admaif2_ep: endpoint { - remote-endpoint = <&xbar_admaif2_ep>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + i2s5_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s5_ep>; }; }; - admaif3_port: port@3 { - reg = <0x3>; + i2s5_port: port@1 { + reg = <1>; - admaif3_ep: endpoint { - remote-endpoint = <&xbar_admaif3_ep>; + i2s5_dap_ep: endpoint { + dai-format = "i2s"; + /* Placeholder for external Codec */ }; }; + }; + }; - admaif4_port: port@4 { - reg = <0x4>; + i2s@2901500 { + status = "okay"; - admaif4_ep: endpoint { - remote-endpoint = <&xbar_admaif4_ep>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + i2s6_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s6_ep>; }; }; - admaif5_port: port@5 { - reg = <0x5>; + i2s6_port: port@1 { + reg = <1>; - admaif5_ep: endpoint { - remote-endpoint = <&xbar_admaif5_ep>; + i2s6_dap_ep: endpoint { + dai-format = "i2s"; + /* Placeholder for external Codec */ }; }; + }; + }; - admaif6_port: port@6 { - reg = <0x6>; + dmic@2904000 { + status = "okay"; - admaif6_ep: endpoint { - remote-endpoint = <&xbar_admaif6_ep>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + dmic1_cif_ep: endpoint { + remote-endpoint = <&xbar_dmic1_ep>; }; }; - admaif7_port: port@7 { - reg = <0x7>; + dmic1_port: port@1 { + reg = <1>; - admaif7_ep: endpoint { - remote-endpoint = <&xbar_admaif7_ep>; + dmic1_dap_ep: endpoint { + /* Place holder for external Codec */ }; }; + }; + }; - admaif8_port: port@8 { - reg = <0x8>; + dmic@2904100 { + status = "okay"; - admaif8_ep: endpoint { - remote-endpoint = <&xbar_admaif8_ep>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + dmic2_cif_ep: endpoint { + remote-endpoint = <&xbar_dmic2_ep>; }; }; - admaif9_port: port@9 { - reg = <0x9>; + dmic2_port: port@1 { + reg = <1>; - admaif9_ep: endpoint { - remote-endpoint = <&xbar_admaif9_ep>; + dmic2_dap_ep: endpoint { + /* Place holder for external Codec */ }; }; + }; + }; - admaif10_port: port@a { - reg = <0xa>; + dmic@2904200 { + status = "okay"; - admaif10_ep: endpoint { - remote-endpoint = <&xbar_admaif10_ep>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + dmic3_cif_ep: endpoint { + remote-endpoint = <&xbar_dmic3_ep>; }; }; - admaif11_port: port@b { - reg = <0xb>; + dmic3_port: port@1 { + reg = <1>; - admaif11_ep: endpoint { - remote-endpoint = <&xbar_admaif11_ep>; + dmic3_dap_ep: endpoint { + /* Place holder for external Codec */ }; }; + }; + }; - admaif12_port: port@c { - reg = <0xc>; + dspk@2905000 { + status = "okay"; - admaif12_ep: endpoint { - remote-endpoint = <&xbar_admaif12_ep>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + dspk1_cif_ep: endpoint { + remote-endpoint = <&xbar_dspk1_ep>; }; }; - admaif13_port: port@d { - reg = <0xd>; + dspk1_port: port@1 { + reg = <1>; - admaif13_ep: endpoint { - remote-endpoint = <&xbar_admaif13_ep>; + dspk1_dap_ep: endpoint { + /* Place holder for external Codec */ }; }; + }; + }; - admaif14_port: port@e { - reg = <0xe>; + dspk@2905100 { + status = "okay"; - admaif14_ep: endpoint { - remote-endpoint = <&xbar_admaif14_ep>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + dspk2_cif_ep: endpoint { + remote-endpoint = <&xbar_dspk2_ep>; }; }; - admaif15_port: port@f { - reg = <0xf>; + dspk2_port: port@1 { + reg = <1>; - admaif15_ep: endpoint { - remote-endpoint = <&xbar_admaif15_ep>; + dspk2_dap_ep: endpoint { + /* Place holder for external Codec */ }; }; + }; + }; - admaif16_port: port@10 { - reg = <0x10>; + sfc@2902000 { + status = "okay"; - admaif16_ep: endpoint { - remote-endpoint = <&xbar_admaif16_ep>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + sfc1_cif_in_ep: endpoint { + remote-endpoint = <&xbar_sfc1_in_ep>; + convert-rate = <44100>; }; }; - admaif17_port: port@11 { - reg = <0x11>; + sfc1_out_port: port@1 { + reg = <1>; - admaif17_ep: endpoint { - remote-endpoint = <&xbar_admaif17_ep>; + sfc1_cif_out_ep: endpoint { + remote-endpoint = <&xbar_sfc1_out_ep>; + convert-rate = <48000>; + }; + }; + }; + }; + + sfc@2902200 { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + sfc2_cif_in_ep: endpoint { + remote-endpoint = <&xbar_sfc2_in_ep>; + }; + }; + + sfc2_out_port: port@1 { + reg = <1>; + + sfc2_cif_out_ep: endpoint { + remote-endpoint = <&xbar_sfc2_out_ep>; + }; + }; + }; + }; + + sfc@2902400 { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + sfc3_cif_in_ep: endpoint { + remote-endpoint = <&xbar_sfc3_in_ep>; + }; + }; + + sfc3_out_port: port@1 { + reg = <1>; + + sfc3_cif_out_ep: endpoint { + remote-endpoint = <&xbar_sfc3_out_ep>; }; }; + }; + }; - admaif18_port: port@12 { - reg = <0x12>; + sfc@2902600 { + status = "okay"; - admaif18_ep: endpoint { - remote-endpoint = <&xbar_admaif18_ep>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + sfc4_cif_in_ep: endpoint { + remote-endpoint = <&xbar_sfc4_in_ep>; }; }; - admaif19_port: port@13 { - reg = <0x13>; + sfc4_out_port: port@1 { + reg = <1>; - admaif19_ep: endpoint { - remote-endpoint = <&xbar_admaif19_ep>; + sfc4_cif_out_ep: endpoint { + remote-endpoint = <&xbar_sfc4_out_ep>; }; }; }; }; - i2s@2901000 { + mvc@290a000 { status = "okay"; ports {
@@ -456,23 +1375,22 @@ port@0 { reg = <0>; - i2s1_cif_ep: endpoint { - remote-endpoint = <&xbar_i2s1_ep>; + mvc1_cif_in_ep: endpoint { + remote-endpoint = <&xbar_mvc1_in_ep>; }; }; - i2s1_port: port@1 { + mvc1_out_port: port@1 { reg = <1>; - i2s1_dap_ep: endpoint { - dai-format = "i2s"; - /* Placeholder for external Codec */ + mvc1_cif_out_ep: endpoint { + remote-endpoint = <&xbar_mvc1_out_ep>; }; }; }; }; - i2s@2901100 { + mvc@290a200 { status = "okay"; ports {
@@ -482,23 +1400,22 @@ port@0 { reg = <0>; - i2s2_cif_ep: endpoint { - remote-endpoint = <&xbar_i2s2_ep>; + mvc2_cif_in_ep: endpoint { + remote-endpoint = <&xbar_mvc2_in_ep>; }; }; - i2s2_port: port@1 { + mvc2_out_port: port@1 { reg = <1>; - i2s2_dap_ep: endpoint { - dai-format = "i2s"; - /* Placeholder for external Codec */ + mvc2_cif_out_ep: endpoint { + remote-endpoint = <&xbar_mvc2_out_ep>; }; }; }; }; - i2s@2901200 { + amx@2903000 { status = "okay"; ports {
@@ -508,23 +1425,46 @@ port@0 { reg = <0>; - i2s3_cif_ep: endpoint { - remote-endpoint = <&xbar_i2s3_ep>; + amx1_in1_ep: endpoint { + remote-endpoint = <&xbar_amx1_in1_ep>; }; }; - i2s3_port: port@1 { + port@1 { reg = <1>; - i2s3_dap_ep: endpoint { - dai-format = "i2s"; - /* Placeholder for external Codec */ + amx1_in2_ep: endpoint { + remote-endpoint = <&xbar_amx1_in2_ep>; + }; + }; + + port@2 { + reg = <2>; + + amx1_in3_ep: endpoint { + remote-endpoint = <&xbar_amx1_in3_ep>; + }; + }; + + port@3 { + reg = <3>; + + amx1_in4_ep: endpoint { + remote-endpoint = <&xbar_amx1_in4_ep>; + }; + }; + + amx1_out_port: port@4 { + reg = <4>; + + amx1_out_ep: endpoint { + remote-endpoint = <&xbar_amx1_out_ep>; }; }; }; }; - i2s@2901300 { + amx@2903100 { status = "okay"; ports {
@@ -534,23 +1474,46 @@ port@0 { reg = <0>; - i2s4_cif_ep: endpoint { - remote-endpoint = <&xbar_i2s4_ep>; + amx2_in1_ep: endpoint { + remote-endpoint = <&xbar_amx2_in1_ep>; }; }; - i2s4_port: port@1 { + port@1 { reg = <1>; - i2s4_dap_ep: endpoint { - dai-format = "i2s"; - /* Placeholder for external Codec */ + amx2_in2_ep: endpoint { + remote-endpoint = <&xbar_amx2_in2_ep>; + }; + }; + + amx2_in3_port: port@2 { + reg = <2>; + + amx2_in3_ep: endpoint { + remote-endpoint = <&xbar_amx2_in3_ep>; + }; + }; + + amx2_in4_port: port@3 { + reg = <3>; + + amx2_in4_ep: endpoint { + remote-endpoint = <&xbar_amx2_in4_ep>; + }; + }; + + amx2_out_port: port@4 { + reg = <4>; + + amx2_out_ep: endpoint { + remote-endpoint = <&xbar_amx2_out_ep>; }; }; }; }; - i2s@2901400 { + amx@2903200 { status = "okay"; ports {
@@ -560,23 +1523,46 @@ port@0 { reg = <0>; - i2s5_cif_ep: endpoint { - remote-endpoint = <&xbar_i2s5_ep>; + amx3_in1_ep: endpoint { + remote-endpoint = <&xbar_amx3_in1_ep>; }; }; - i2s5_port: port@1 { + port@1 { reg = <1>; - i2s5_dap_ep: endpoint { - dai-format = "i2s"; - /* Placeholder for external Codec */ + amx3_in2_ep: endpoint { + remote-endpoint = <&xbar_amx3_in2_ep>; + }; + }; + + port@2 { + reg = <2>; + + amx3_in3_ep: endpoint { + remote-endpoint = <&xbar_amx3_in3_ep>; + }; + }; + + port@3 { + reg = <3>; + + amx3_in4_ep: endpoint { + remote-endpoint = <&xbar_amx3_in4_ep>; + }; + }; + + amx3_out_port: port@4 { + reg = <4>; + + amx3_out_ep: endpoint { + remote-endpoint = <&xbar_amx3_out_ep>; }; }; }; }; - i2s@2901500 { + amx@2903300 { status = "okay"; ports {
@@ -586,23 +1572,46 @@ port@0 { reg = <0>; - i2s6_cif_ep: endpoint { - remote-endpoint = <&xbar_i2s6_ep>; + amx4_in1_ep: endpoint { + remote-endpoint = <&xbar_amx4_in1_ep>; }; }; - i2s6_port: port@1 { + port@1 { reg = <1>; - i2s6_dap_ep: endpoint { - dai-format = "i2s"; - /* Placeholder for external Codec */ + amx4_in2_ep: endpoint { + remote-endpoint = <&xbar_amx4_in2_ep>; + }; + }; + + port@2 { + reg = <2>; + + amx4_in3_ep: endpoint { + remote-endpoint = <&xbar_amx4_in3_ep>; + }; + }; + + port@3 { + reg = <3>; + + amx4_in4_ep: endpoint { + remote-endpoint = <&xbar_amx4_in4_ep>; + }; + }; + + amx4_out_port: port@4 { + reg = <4>; + + amx4_out_ep: endpoint { + remote-endpoint = <&xbar_amx4_out_ep>; }; }; }; }; - dmic@2904000 { + adx@2903800 { status = "okay"; ports {
@@ -612,22 +1621,46 @@ port@0 { reg = <0>; - dmic1_cif_ep: endpoint { - remote-endpoint = <&xbar_dmic1_ep>; + adx1_in_ep: endpoint { + remote-endpoint = <&xbar_adx1_in_ep>; }; }; - dmic1_port: port@1 { + adx1_out1_port: port@1 { reg = <1>; - dmic1_dap_ep: endpoint { - /* Place holder for external Codec */ + adx1_out1_ep: endpoint { + remote-endpoint = <&xbar_adx1_out1_ep>; + }; + }; + + adx1_out2_port: port@2 { + reg = <2>; + + adx1_out2_ep: endpoint { + remote-endpoint = <&xbar_adx1_out2_ep>; + }; + }; + + adx1_out3_port: port@3 { + reg = <3>; + + adx1_out3_ep: endpoint { + remote-endpoint = <&xbar_adx1_out3_ep>; + }; + }; + + adx1_out4_port: port@4 { + reg = <4>; + + adx1_out4_ep: endpoint { + remote-endpoint = <&xbar_adx1_out4_ep>; }; }; }; }; - dmic@2904100 { + adx@2903900 { status = "okay"; ports {
@@ -637,22 +1670,46 @@ port@0 { reg = <0>; - dmic2_cif_ep: endpoint { - remote-endpoint = <&xbar_dmic2_ep>; + adx2_in_ep: endpoint { + remote-endpoint = <&xbar_adx2_in_ep>; }; }; - dmic2_port: port@1 { + adx2_out1_port: port@1 { reg = <1>; - dmic2_dap_ep: endpoint { - /* Place holder for external Codec */ + adx2_out1_ep: endpoint { + remote-endpoint = <&xbar_adx2_out1_ep>; + }; + }; + + adx2_out2_port: port@2 { + reg = <2>; + + adx2_out2_ep: endpoint { + remote-endpoint = <&xbar_adx2_out2_ep>; + }; + }; + + adx2_out3_port: port@3 { + reg = <3>; + + adx2_out3_ep: endpoint { + remote-endpoint = <&xbar_adx2_out3_ep>; + }; + }; + + adx2_out4_port: port@4 { + reg = <4>; + + adx2_out4_ep: endpoint { + remote-endpoint = <&xbar_adx2_out4_ep>; }; }; }; }; - dmic@2904200 { + adx@2903a00 { status = "okay"; ports {
@@ -662,22 +1719,46 @@ port@0 { reg = <0>; - dmic3_cif_ep: endpoint { - remote-endpoint = <&xbar_dmic3_ep>; + adx3_in_ep: endpoint { + remote-endpoint = <&xbar_adx3_in_ep>; }; }; - dmic3_port: port@1 { + adx3_out1_port: port@1 { reg = <1>; - dmic3_dap_ep: endpoint { - /* Place holder for external Codec */ + adx3_out1_ep: endpoint { + remote-endpoint = <&xbar_adx3_out1_ep>; + }; + }; + + adx3_out2_port: port@2 { + reg = <2>; + + adx3_out2_ep: endpoint { + remote-endpoint = <&xbar_adx3_out2_ep>; + }; + }; + + adx3_out3_port: port@3 { + reg = <3>; + + adx3_out3_ep: endpoint { + remote-endpoint = <&xbar_adx3_out3_ep>; + }; + }; + + adx3_out4_port: port@4 { + reg = <4>; + + adx3_out4_ep: endpoint { + remote-endpoint = <&xbar_adx3_out4_ep>; }; }; }; }; - dspk@2905000 { + adx@2903b00 { status = "okay"; ports {
@@ -687,22 +1768,46 @@ port@0 { reg = <0>; - dspk1_cif_ep: endpoint { - remote-endpoint = <&xbar_dspk1_ep>; + adx4_in_ep: endpoint { + remote-endpoint = <&xbar_adx4_in_ep>; }; }; - dspk1_port: port@1 { + adx4_out1_port: port@1 { reg = <1>; - dspk1_dap_ep: endpoint { - /* Place holder for external Codec */ + adx4_out1_ep: endpoint { + remote-endpoint = <&xbar_adx4_out1_ep>; + }; + }; + + adx4_out2_port: port@2 { + reg = <2>; + + adx4_out2_ep: endpoint { + remote-endpoint = <&xbar_adx4_out2_ep>; + }; + }; + + adx4_out3_port: port@3 { + reg = <3>; + + adx4_out3_ep: endpoint { + remote-endpoint = <&xbar_adx4_out3_ep>; + }; + }; + + adx4_out4_port: port@4 { + reg = <4>; + + adx4_out4_ep: endpoint { + remote-endpoint = <&xbar_adx4_out4_ep>; }; }; }; }; - dspk@2905100 { + amixer@290bb00 { status = "okay"; ports {
@@ -710,18 +1815,122 @@ #size-cells = <0>; port@0 { - reg = <0>; + reg = <0x0>; - dspk2_cif_ep: endpoint { - remote-endpoint = <&xbar_dspk2_ep>; + mixer_in1_ep: endpoint { + remote-endpoint = <&xbar_mixer_in1_ep>; }; }; - dspk2_port: port@1 { - reg = <1>; + port@1 { + reg = <0x1>; - dspk2_dap_ep: endpoint { - /* Place holder for external Codec */ + mixer_in2_ep: endpoint { + remote-endpoint = <&xbar_mixer_in2_ep>; + }; + }; + + port@2 { + reg = <0x2>; + + mixer_in3_ep: endpoint { + remote-endpoint = <&xbar_mixer_in3_ep>; + }; + }; + + port@3 { + reg = <0x3>; + + mixer_in4_ep: endpoint { + remote-endpoint = <&xbar_mixer_in4_ep>; + }; + }; + + port@4 { + reg = <0x4>; + + mixer_in5_ep: endpoint { + remote-endpoint = <&xbar_mixer_in5_ep>; + }; + }; + + port@5 { + reg = <0x5>; + + mixer_in6_ep: endpoint { + remote-endpoint = <&xbar_mixer_in6_ep>; + }; + }; + + port@6 { + reg = <0x6>; + + mixer_in7_ep: endpoint { + remote-endpoint = <&xbar_mixer_in7_ep>; + }; + }; + + port@7 { + reg = <0x7>; + + mixer_in8_ep: endpoint { + remote-endpoint = <&xbar_mixer_in8_ep>; + }; + }; + + port@8 { + reg = <0x8>; + + mixer_in9_ep: endpoint { + remote-endpoint = <&xbar_mixer_in9_ep>; + }; + }; + + port@9 { + reg = <0x9>; + + mixer_in10_ep: endpoint { + remote-endpoint = <&xbar_mixer_in10_ep>; + }; + }; + + mixer_out1_port: port@a { + reg = <0xa>; + + mixer_out1_ep: endpoint { + remote-endpoint = <&xbar_mixer_out1_ep>; + }; + }; + + mixer_out2_port: port@b { + reg = <0xb>; + + mixer_out2_ep: endpoint { + remote-endpoint = <&xbar_mixer_out2_ep>; + }; + }; + + mixer_out3_port: port@c { + reg = <0xc>; + + mixer_out3_ep: endpoint { + remote-endpoint = <&xbar_mixer_out3_ep>; + }; + }; + + mixer_out4_port: port@d { + reg = <0xd>; + + mixer_out4_ep: endpoint { + remote-endpoint = <&xbar_mixer_out4_ep>; + }; + }; + + mixer_out5_port: port@e { + reg = <0xe>; + + mixer_out5_ep: endpoint { + remote-endpoint = <&xbar_mixer_out5_ep>; }; }; };
@@ -1104,6 +2313,41 @@ <&xbar_i2s4_port>, <&xbar_i2s5_port>, <&xbar_i2s6_port>, <&xbar_dmic1_port>, <&xbar_dmic2_port>, <&xbar_dmic3_port>, <&xbar_dspk1_port>, <&xbar_dspk2_port>, + <&xbar_sfc1_in_port>, <&xbar_sfc2_in_port>, + <&xbar_sfc3_in_port>, <&xbar_sfc4_in_port>, + <&xbar_mvc1_in_port>, <&xbar_mvc2_in_port>, + <&xbar_amx1_in1_port>, <&xbar_amx1_in2_port>, + <&xbar_amx1_in3_port>, <&xbar_amx1_in4_port>, + <&xbar_amx2_in1_port>, <&xbar_amx2_in2_port>, + <&xbar_amx2_in3_port>, <&xbar_amx2_in4_port>, + <&xbar_amx3_in1_port>, <&xbar_amx3_in2_port>, + <&xbar_amx3_in3_port>, <&xbar_amx3_in4_port>, + <&xbar_amx4_in1_port>, <&xbar_amx4_in2_port>, + <&xbar_amx4_in3_port>, <&xbar_amx4_in4_port>, + <&xbar_adx1_in_port>, <&xbar_adx2_in_port>, + <&xbar_adx3_in_port>, <&xbar_adx4_in_port>, + <&xbar_mixer_in1_port>, <&xbar_mixer_in2_port>, + <&xbar_mixer_in3_port>, <&xbar_mixer_in4_port>, + <&xbar_mixer_in5_port>, <&xbar_mixer_in6_port>, + <&xbar_mixer_in7_port>, <&xbar_mixer_in8_port>, + <&xbar_mixer_in9_port>, <&xbar_mixer_in10_port>, + /* HW accelerators */ + <&sfc1_out_port>, <&sfc2_out_port>, + <&sfc3_out_port>, <&sfc4_out_port>, + <&mvc1_out_port>, <&mvc2_out_port>, + <&amx1_out_port>, <&amx2_out_port>, + <&amx3_out_port>, <&amx4_out_port>, + <&adx1_out1_port>, <&adx1_out2_port>, + <&adx1_out3_port>, <&adx1_out4_port>, + <&adx2_out1_port>, <&adx2_out2_port>, + <&adx2_out3_port>, <&adx2_out4_port>, + <&adx3_out1_port>, <&adx3_out2_port>, + <&adx3_out3_port>, <&adx3_out4_port>, + <&adx4_out1_port>, <&adx4_out2_port>, + <&adx4_out3_port>, <&adx4_out4_port>, + <&mixer_out1_port>, <&mixer_out2_port>, + <&mixer_out3_port>, <&mixer_out4_port>, + <&mixer_out5_port>, /* I/O */ <&i2s1_port>, <&i2s2_port>, <&i2s3_port>, <&i2s4_port>, <&i2s5_port>, <&i2s6_port>, <&dmic1_port>, <&dmic2_port>,
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +1367 -126
1,173 lines not on this page · raw message
arch/arm64/boot/dts/nvidia/tegra194-p3509-0000.dtsi +1382 -138
1,520 lines not on this page · raw message
arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts +876 -0
876 lines not on this page · raw message
arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts +876 -0
876 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.7.4
Part of the diff is not shown here. View the raw message.
Rob Herring
maintainerRe: [PATCH 04/13] ASoC: dt-bindings: tegra: Few more Tegra210 AHUB modules
In reply to Sameer PujarQuoted 33 lines · Sameer Pujar
This patch adds YAML schema for DT bindings of few AHUB modules. These devices will be registered as ASoC components and bindings will be used on Tegra210 and later chips. The bindings for below mentioned modules are added:
* SFC (Sampling Frequency Converter)
* MVC (Master Volume Control)
* AMX (Audio Multiplexer)
* ADX (Audio Demultiplexer)
* MixerSigned-off-by Sameer Pujar <[email protected]>Cc Rob Herring <[email protected]>--- .../bindings/sound/nvidia,tegra210-adx.yaml | 74 ++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-ahub.yaml | 20 ++++++ .../bindings/sound/nvidia,tegra210-amx.yaml | 72 ++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-mixer.yaml | 67 ++++++++++++++++++ .../bindings/sound/nvidia,tegra210-mvc.yaml | 79 ++++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-sfc.yaml | 76 +++++++++++++++++++++ 6 files changed, 388 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-amx.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-mixer.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-mvc.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-sfc.yamlDocumentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml new file +0
-0
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml line 10
Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml new file +10
-0@@ -0,0 +1,74 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra210-adx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Tegra210 ADX Device Tree Bindings + +description: | + The Audio Demultiplexer (ADX) block takes an input stream with up to
extra spaces.
Quoted 17 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml new file +17
-0+ 16 channels and demultiplexes it into four output streams of up to 16 + channels each. A byte RAM helps to form output frames by any combination + of bytes from the input frame. Its design is identical to that of byte + RAM in the AMX except that the data flow direction is reversed. + +maintainers: + - Jon Hunter <[email protected]> + - Mohan Kumar <[email protected]> + - Sameer Pujar <[email protected]> + +properties: + $nodename: + pattern: "^adx@[0-9a-f]*$" + + compatible: + oneOf: + - const: nvidia,tegra210-adx
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml line 37
Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml new file +10
-0+ - items: + - enum: + - nvidia,tegra194-adx + - nvidia,tegra186-adx + - const: nvidia,tegra210-adx + + reg: + maxItems: 1 + + sound-name-prefix:
nvidia,sound-name-prefix
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml line 49
Quoted 12 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml new file +12
-0+ pattern: "^ADX[1-9]$" + $ref: /schemas/types.yaml#/definitions/string + description: + used as prefix for sink/source names of the component. Must be a + unique string among multiple instances of the same component. + The name can be "ADX1" or "ADX2" ... "ADXx", where x depends on + the maximum available instances on a Tegra SoC. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + description: | + ADX has one input and four output. Accordingly ACIF (Audio Client
You need to define the port numbers for the input and each output.
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml line 55
Quoted 6 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml new file +6
-0+ Interface) RX and TX port nodes are defined to represent ADX inputs + and output respectively. These are connected to corresponding ports + on AHUB. + + patternProperties: + '^port@[0-9]':
Per above, this will need to be split at least into input and output ports.
Same issues in the other schemas.
Quoted 160 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml new file +19
-0+ $ref: audio-graph-port.yaml# + unevaluatedProperties: false + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + + adx@702d3800 { + compatible = "nvidia,tegra210-adx"; + reg = <0x702d3800 0x100>; + sound-name-prefix = "ADX1"; + }; + +...Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml +20
-0@@ -85,6 +85,26 @@ patternProperties: type: object $ref: nvidia,tegra186-dspk.yaml# + '^mvc@[0-9a-f]+$': + type: object + $ref: nvidia,tegra210-mvc.yaml# + + '^sfc@[0-9a-f]+$': + type: object + $ref: nvidia,tegra210-sfc.yaml# + + '^amx@[0-9a-f]+$': + type: object + $ref: nvidia,tegra210-amx.yaml# + + '^adx@[0-9a-f]+$': + type: object + $ref: nvidia,tegra210-adx.yaml# + + '^mixer@[0-9a-f]+$': + type: object + $ref: nvidia,tegra210-mixer.yaml# + required: - compatible - regDocumentation/devicetree/bindings/sound/nvidia,tegra210-amx.yaml new file +72
-0@@ -0,0 +1,72 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra210-amx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Tegra210 AMX Device Tree Bindings + +description: | + The Audio Multiplexer (AMX) block can multiplex up to four input streams + each of which can have maximum 16 channels and generate an output stream + with maximum 16 channels. A byte RAM helps to form an output frame by + any combination of bytes from the input frames. + +maintainers: + - Jon Hunter <[email protected]> + - Mohan Kumar <[email protected]> + - Sameer Pujar <[email protected]> + +properties: + $nodename: + pattern: "^amx@[0-9a-f]*$" + + compatible: + oneOf: + - const: nvidia,tegra210-amx + - items: + - const: nvidia,tegra186-amx + - const: nvidia,tegra210-amx + - const: nvidia,tegra194-amx + + reg: + maxItems: 1 + + sound-name-prefix: + pattern: "^AMX[1-9]$" + $ref: /schemas/types.yaml#/definitions/string + description: + used as prefix for sink/source names of the component. Must be a + unique string among multiple instances of the same component. + The name can be "AMX1" or "AMX2" ... "AMXx", where x depends on + the maximum available instances on a Tegra SoC. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + description: | + AMX has four inputs and one output. Accordingly ACIF (Audio Client + Interfaces) RX and TX port nodes are defined to represent AMX inputs + and output respectively. These are connected to corresponding ports + on AHUB. + + patternProperties: + '^port@[0-9]': + $ref: audio-graph-port.yaml# + unevaluatedProperties: false + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + + amx@702d3000 { + compatible = "nvidia,tegra210-amx"; + reg = <0x702d3000 0x100>; + sound-name-prefix = "AMX1"; + }; + +...Documentation/devicetree/bindings/sound/nvidia,tegra210-mixer.yaml new file +26
-0@@ -0,0 +1,67 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra210-mixer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Tegra210 Mixer Device Tree Bindings + +description: | + The Mixer supports mixing of up to ten 7.1 audio input streams and + generate five outputs (each of which can be any combination of the + ten input streams). + +maintainers: + - Jon Hunter <[email protected]> + - Mohan Kumar <[email protected]> + - Sameer Pujar <[email protected]> + +properties: + $nodename: + pattern: "^mixer@[0-9a-f]*$" + + compatible: + oneOf: + - const: nvidia,tegra210-amixer + - items:
Documentation/devicetree/bindings/sound/nvidia,tegra210-mixer.yaml line 36
Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-mixer.yaml new file +10
-0+ - enum: + - nvidia,tegra194-amixer + - nvidia,tegra186-amixer + - const: nvidia,tegra210-amixer + + reg: + maxItems: 1 + + sound-name-prefix: + const: "MIXER"
Don't need quotes. A fixed string seems a bit pointless to put into DT.
Quoted 202 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-mixer.yaml new file +31
-0+ $ref: /schemas/types.yaml#/definitions/string + + ports: + $ref: /schemas/graph.yaml#/properties/ports + description: | + Mixer has ten inputs and five outputs. Accordingly ACIF (Audio Client + Interfaces) RX and TX port nodes are defined to represent MIXER inputs + and outputs respectively. These are connected to corresponding ports + on AHUB. + + patternProperties: + '^port@[0-9]': + $ref: audio-graph-port.yaml# + unevaluatedProperties: false + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + + mixer@702dbb00 { + compatible = "nvidia,tegra210-amixer"; + reg = <0x702dbb00 0x800>; + sound-name-prefix = "MIXER"; + }; + +...Documentation/devicetree/bindings/sound/nvidia,tegra210-mvc.yaml new file +79
-0@@ -0,0 +1,79 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra210-mvc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Tegra210 MVC Device Tree Bindings + +description: | + The Master Volume Control (MVC) provides gain or attenuation to a digital + signal path. It can be used in input or output signal path for per-stream + volume control or it can be used as master volume control. The MVC block + has one input and one output. The input digital stream can be mono or + multi-channel (up to 7.1 channels) stream. An independent mute control is + also included in the MVC block. + +maintainers: + - Jon Hunter <[email protected]> + - Mohan Kumar <[email protected]> + - Sameer Pujar <[email protected]> + +properties: + $nodename: + pattern: "^mvc@[0-9a-f]*$" + + compatible: + oneOf: + - const: nvidia,tegra210-mvc + - items: + - enum: + - nvidia,tegra194-mvc + - nvidia,tegra186-mvc + - const: nvidia,tegra210-mvc + + reg: + maxItems: 1 + + sound-name-prefix: + pattern: "^MVC[1-9]$" + $ref: /schemas/types.yaml#/definitions/string + description: + used as prefix for sink/source names of the component. Must be a + unique string among multiple instances of the same component. + The name can be "MVC1" or "MVC2" ... "MVCx", where x depends on + the maximum available instances on a Tegra SoC. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + properties: + port@0: + $ref: audio-graph-port.yaml# + unevaluatedProperties: false + description: | + ACIF (Audio Client Interface) acting as MVC input (RX) port. + This is connected to corresponding ACIF port on AHUB. + + port@1: + $ref: audio-graph-port.yaml# + unevaluatedProperties: false + description: | + ACIF (Audio Client Interface) acting as MVC output (TX) port. + This is connected to corresponding ACIF port on AHUB. + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + + mvc@702da000 { + compatible = "nvidia,tegra210-mvc"; + reg = <0x702da000 0x200>; + sound-name-prefix = "MVC1"; + }; + +...Documentation/devicetree/bindings/sound/nvidia,tegra210-sfc.yaml new file +76
-0@@ -0,0 +1,76 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra210-sfc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Tegra210 SFC Device Tree Bindings + +description: | + The Sampling Frequency Converter (SFC) converts the sampling frequency + of the input signal from one frequency to another. It supports sampling + frequency conversions of streams of up to two channels (stereo). + +maintainers: + - Jon Hunter <[email protected]> + - Mohan Kumar <[email protected]> + - Sameer Pujar <[email protected]> + +properties: + $nodename: + pattern: "^sfc@[0-9a-f]*$" + + compatible: + oneOf: + - const: nvidia,tegra210-sfc + - items: + - enum: + - nvidia,tegra194-sfc + - nvidia,tegra186-sfc + - const: nvidia,tegra210-sfc + + reg: + maxItems: 1 + + sound-name-prefix: + pattern: "^SFC[1-9]$" + $ref: /schemas/types.yaml#/definitions/string + description: + used as prefix for sink/source names of the component. Must be a + unique string among multiple instances of the same component. + The name can be "SFC1" or "SFC2" ... "SFCx", where x depends on + the maximum available instances on a Tegra SoC. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + properties: + port@0: + $ref: audio-graph-port.yaml# + unevaluatedProperties: false + description: | + ACIF (Audio Client Interface) acting as SFC input (RX) port. + This is connected to corresponding ACIF port on AHUB. + + port@1: + $ref: audio-graph-port.yaml# + unevaluatedProperties: false + description: | + ACIF (Audio Client Interface) acting as SFC output (TX) port. + This is connected to corresponding ACIF port on AHUB. + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + + sfc@702d2000 { + compatible = "nvidia,tegra210-sfc"; + reg = <0x702d2000 0x200>; + sound-name-prefix = "SFC1"; + }; + +...Signature · 1 line
2.7.4
Re: [PATCH 04/13] ASoC: dt-bindings: tegra: Few more Tegra210 AHUB modules
Hi Rob,
Thanks for feedback.
Quoted 27 lines · Rob Herring
Quoted 26 lines · Sameer Pujar
This patch adds YAML schema for DT bindings of few AHUB modules. These devices will be registered as ASoC components and bindings will be used on Tegra210 and later chips. The bindings for below mentioned modules are added:
* SFC (Sampling Frequency Converter)
* MVC (Master Volume Control)
* AMX (Audio Multiplexer)
* ADX (Audio Demultiplexer)
* MixerSigned-off-by Sameer Pujar <[email protected]>Cc Rob Herring <[email protected]>--- .../bindings/sound/nvidia,tegra210-adx.yaml | 74 ++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-ahub.yaml | 20 ++++++ .../bindings/sound/nvidia,tegra210-amx.yaml | 72 ++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-mixer.yaml | 67 ++++++++++++++++++ .../bindings/sound/nvidia,tegra210-mvc.yaml | 79 ++++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-sfc.yaml | 76 +++++++++++++++++++++ 6 files changed, 388 insertions(+)create mode 100644
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yamlcreate mode 100644Documentation/devicetree/bindings/sound/nvidia,tegra210-amx.yamlcreate mode 100644Documentation/devicetree/bindings/sound/nvidia,tegra210-mixer.yamlcreate mode 100644Documentation/devicetree/bindings/sound/nvidia,tegra210-mvc.yamlcreate mode 100644Documentation/devicetree/bindings/sound/nvidia,tegra210-sfc.yaml
[...]
Quoted 20 lines
Quoted 20 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml new file +20
-0+ 16 channels and demultiplexes it into four output streams of up to 16 + channels each. A byte RAM helps to form output frames by any combination + of bytes from the input frame. Its design is identical to that of byte + RAM in the AMX except that the data flow direction is reversed. + +maintainers: + - Jon Hunter <[email protected]> + - Mohan Kumar <[email protected]> + - Sameer Pujar <[email protected]> + +properties: + $nodename: + pattern: "^adx@[0-9a-f]*$" + + compatible: + oneOf: + - const: nvidia,tegra210-adx + - items: + - enum: + - nvidia,tegra194-adx
Quoted 8 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml line 37
Quoted 7 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml new file +7
-0+ - nvidia,tegra186-adx + - const: nvidia,tegra210-adx + + reg: + maxItems: 1 + + sound-name-prefix:nvidia,sound-name-prefix
It is supposed to be 'sound-name-prefix' for core to parse and apply prefix. May be this needs to be directly referenced from 'Documentation/devicetree/bindings/sound/name-prefix.txt' after converting to YAML, which can be a separate commit?
Remaining comments will be taken care in next revision.
Mark Brown
maintainerRe: [PATCH 06/13] ASoC: tegra: Add Tegra210 based MVC driver
In reply to Sameer PujarQuoted 6 lines · Sameer Pujar
The Master Volume Control (MVC) provides gain or attenuation to a digital signal path. It can be used in input or output signal path for per-stream volume control or it can be used as master volume control. The MVC block has one input and one output. The input digital stream can be mono or multi-channel (up to 7.1 channels) stream. An independent mute control is also included in the MVC block.
Looks like it's also got a little bit of other DSP in there (a simple EQ?). Not that it really matters.
sound/soc/tegra/tegra210_mvc.c line 127
Quoted 7 lines
sound/soc/tegra/tegra210_mvc.c new file +6
-0+if (reg ==TEGRA210_MVC_CTRL ) { +u32 val; +u8 mute_mask; + }else { +u8 chan = (reg -TEGRA210_MVC_TARGET_VOL ) /REG_SIZE ; +s32 val = mvc->volume[chan];
It's not clear to me why we're using the same callbacks for the volume and mute settings - there's no shared code on the read path and only a tiny bit on the write path.
sound/soc/tegra/tegra210_mvc.c line 211
Quoted 8 lines
sound/soc/tegra/tegra210_mvc.c new file +8
-0+ err |=regmap_update_bits (mvc->regmap,TEGRA210_MVC_SWITCH , +TEGRA210_MVC_VOLUME_SWITCH_MASK , +TEGRA210_MVC_VOLUME_SWITCH_TRIGGER ); + +end: +pm_runtime_put (cmpnt->dev); +return err; +}
_put() should return 0 if there's no change or 1 for a change.
sound/soc/tegra/tegra210_mvc.c line 329
Quoted 2 lines
sound/soc/tegra/tegra210_mvc.c new file +2
-0+/* SW reset */ +regmap_write (mvc->regmap,TEGRA210_MVC_SOFT_RESET ,1 );
What about all the cached values in the regmap, won't they get out of sync? Especially things like volume and mute, it looks like the mute just gets written directly to the regmap and not otherwise saved.
Re: [PATCH 06/13] ASoC: tegra: Add Tegra210 based MVC driver
Hi Mark,
Thank you for review.
Quoted 9 lines · Mark Brown
Quoted 6 lines · Sameer Pujar
The Master Volume Control (MVC) provides gain or attenuation to a digital signal path. It can be used in input or output signal path for per-stream volume control or it can be used as master volume control. The MVC block has one input and one output. The input digital stream can be mono or multi-channel (up to 7.1 channels) stream. An independent mute control is also included in the MVC block.
Looks like it's also got a little bit of other DSP in there (a simple EQ?). Not that it really matters.
MVC does not have EQ block. In fact it is part of another processing module, the driver for which is not part of this series.
Quoted 9 lines
sound/soc/tegra/tegra210_mvc.c line 127
Quoted 6 lines
sound/soc/tegra/tegra210_mvc.c new file +6
-0+if (reg ==TEGRA210_MVC_CTRL ) { +u32 val; +u8 mute_mask; + }else { +u8 chan = (reg -TEGRA210_MVC_TARGET_VOL ) /REG_SIZE ; +s32 val = mvc->volume[chan];It's not clear to me why we're using the same callbacks for the volume and mute settings - there's no shared code on the read path and only a tiny bit on the write path.
The volume switch trigger is common in put(). The get() is probably influenced from the put() and common function is maintained. If it makes more clear I will separate these out.
Quoted 9 lines
sound/soc/tegra/tegra210_mvc.c line 211
Quoted 8 lines
sound/soc/tegra/tegra210_mvc.c new file +8
-0+ err |=regmap_update_bits (mvc->regmap,TEGRA210_MVC_SWITCH , +TEGRA210_MVC_VOLUME_SWITCH_MASK , +TEGRA210_MVC_VOLUME_SWITCH_TRIGGER ); + +end: +pm_runtime_put (cmpnt->dev); +return err; +}
_put()should return 0 if there's no change or 1 for a change.
done
Quoted 5 lines
sound/soc/tegra/tegra210_mvc.c line 329
Quoted 2 lines
sound/soc/tegra/tegra210_mvc.c new file +2
-0+/* SW reset */ +regmap_write (mvc->regmap,TEGRA210_MVC_SOFT_RESET ,1 );What about all the cached values in the regmap, won't they get out of sync? Especially things like volume and mute, it looks like the mute just gets written directly to the regmap and not otherwise saved.
1. I think original idea was to disable MVC (forcefully) before new configurations are applied and eventually it gets enabled via DAPM path. DAPM path handles disable also, but sometimes MVC may get stuck in enable state (due to a previous usage) when all the data in pipeline is not processed. My understanding is that reset is restricted to this alone. The volume/mute registers seem not to be affected by reset. However I will confirm with HW about the reset behavior and affected register map. Thanks for pointing this.
2. The mute is part of volatile register and volume is not. If the system is muted and any volume settings are made, the system is unmuted automatically. For this reason mute is always read from HW. For volume it is saved for local computation.
Hi All,
Quoted 22 lines · Sameer Pujar
Earlier as part of series [0], support for ADMAIF and I/O modules (such as I2S, DMIC and DSPK) was added. This series aims at exposing some of the AHUB internal modules (listed below), which can be used for audio pre or post processing.
* SFC (Sampling Frequency Converter)
* MVC (Master Volume Control)
* AMX (Audio Multiplexer)
* ADX (Audio Demultiplexer)
* MixerThese modules can be plugged into audio paths and relevant processing can be done. The MUX routes are extended to allow add or remove above modules in the path via mixer controls. This is similar to how specific ADMAIF channels are connected to relevant I/O module instances at the moment.
Some of these modules can alter PCM parameters. Consider example of resampler (44.1 -> 48 kHz) in the path.
aplay(44.1 kHz) -> ADMAIF -> SFC -> (48 kHz) I2S -> (48kHz) Codec
Quoted 9 lines
The modules following SFC should be using converted sample rate and DAIs need to be configured accordingly. The audio-graph driver provides a mechanism to fixup the new parameters which can be specified in DT for a given DAI. Then core uses these new values via fixup callback and then pass it to respective DAIs
hw_param()callback. The "convert-rate", described in [1], property can be used when there is rate conversion in the audio path. Similarly "convert-channels" can be used when there is channel conversion in the path. There is no "convert-xxx" property for sample size conversions. It can be added if necessary.
In above example, as we see the modules following SFC should be using converted PCM parameters (sample rate in above case). For this I am currently relying on DT properties ('convert-xxx') which is supported by audio-graph-card. This works fine for a static PCM configuration and may be fine to start with. But going ahead a more flexible configuration is preferred (without the need of a reboot). This came up during [0], but now with the introduction of processing modules in the path it becomes more important and would be nice to get this addressed.
Are there any mechanisms in place which can be leveraged to apply PCM configurations at runtime? Or any directions/ideas we want to explore?
Any feedback or pointers will be of great help.
[0] https://lkml.org/lkml/2020/2/24/599
Thanks,
Sameer.
Re: [PATCH 06/13] ASoC: tegra: Add Tegra210 based MVC driver
In reply to Sameer PujarQuoted 11 lines · Sameer Pujar
Quoted 7 lines · Mark Brown
sound/soc/tegra/tegra210_mvc.c line 329
Quoted 2 lines · Sameer Pujar
sound/soc/tegra/tegra210_mvc.c new file +2
-0+/* SW reset */ +regmap_write (mvc->regmap,TEGRA210_MVC_SOFT_RESET ,1 );What about all the cached values in the regmap, won't they get out of sync? Especially things like volume and mute, it looks like the mute just gets written directly to the regmap and not otherwise saved.
1. I think original idea was to disable MVC (forcefully) before new configurations are applied and eventually it gets enabled via DAPM path. DAPM path handles disable also, but sometimes MVC may get stuck in enable state (due to a previous usage) when all the data in pipeline is not processed. My understanding is that reset is restricted to this alone. The volume/mute registers seem not to be affected by reset. However I will confirm with HW about the reset behavior and affected register map. Thanks for pointing this.
I confirmed the behavior with HW folk here. The reset above clears all FSM, flushes flow control of FIFO and resets the state registers. It also brings module back to disabled state (without flushing the data in the pipe). There is no impact on the register cache, as state registers are anyway volatile and module disable is applicable only when it was hung in previous usage. Otherwise DAPM would disable the module during session close.
Mark Brown
maintainerRe: [PATCH 06/13] ASoC: tegra: Add Tegra210 based MVC driver
Quoted 19 lines · Sameer Pujar
Quoted 9 lines · Sameer Pujar
Quoted 7 lines · Mark Brown
sound/soc/tegra/tegra210_mvc.c line 329
Quoted 2 lines · Sameer Pujar
sound/soc/tegra/tegra210_mvc.c new file +2
-0+/* SW reset */ +regmap_write (mvc->regmap,TEGRA210_MVC_SOFT_RESET ,1 );What about all the cached values in the regmap, won't they get out of sync? Especially things like volume and mute, it looks like the mute just gets written directly to the regmap and not otherwise saved.
Quoted 8 lines
1. I think original idea was to disable MVC (forcefully) before new configurations are applied and eventually it gets enabled via DAPM path. DAPM path handles disable also, but sometimes MVC may get stuck in enable state (due to a previous usage) when all the data in pipeline is not processed. My understanding is that reset is restricted to this alone. The volume/mute registers seem not to be affected by reset. However I will confirm with HW about the reset behavior and affected register map. Thanks for pointing this.
Quoted 6 lines
I confirmed the behavior with HW folk here. The reset above clears all FSM, flushes flow control of FIFO and resets the state registers. It also brings module back to disabled state (without flushing the data in the pipe). There is no impact on the register cache, as state registers are anyway volatile and module disable is applicable only when it was hung in previous usage. Otherwise DAPM would disable the module during session close.
This needs to be *much* clearer in the code, it looks like a bug at the minute. It's very surprising that some of the registers wouldn't be affected by a reset.
Re: [PATCH 06/13] ASoC: tegra: Add Tegra210 based MVC driver
Quoted 23 lines · Mark Brown
Quoted 16 lines · Sameer Pujar
Quoted 7 lines · Sameer Pujar
Quoted 6 lines · Mark Brown
sound/soc/tegra/tegra210_mvc.c line 329
Quoted 2 lines · Sameer Pujar
sound/soc/tegra/tegra210_mvc.c new file +2
-0+/* SW reset */ +regmap_write (mvc->regmap,TEGRA210_MVC_SOFT_RESET ,1 );What about all the cached values in the regmap, won't they get out of sync? Especially things like volume and mute, it looks like the mute just gets written directly to the regmap and not otherwise saved.
Quoted 8 lines
1. I think original idea was to disable MVC (forcefully) before new configurations are applied and eventually it gets enabled via DAPM path. DAPM path handles disable also, but sometimes MVC may get stuck in enable state (due to a previous usage) when all the data in pipeline is not processed. My understanding is that reset is restricted to this alone. The volume/mute registers seem not to be affected by reset. However I will confirm with HW about the reset behavior and affected register map. Thanks for pointing this.
Quoted 6 lines
I confirmed the behavior with HW folk here. The reset above clears all FSM, flushes flow control of FIFO and resets the state registers. It also brings module back to disabled state (without flushing the data in the pipe). There is no impact on the register cache, as state registers are anyway volatile and module disable is applicable only when it was hung in previous usage. Otherwise DAPM would disable the module during session close.
Quoted 3 lines
This needs to be*much* clearer in the code, it looks like a bug at the minute. It's very surprising that some of the registers wouldn't be affected by a reset.
I will put additional comments to make it more clear and tag it as a 'soft reset' instead of 'reset' as HW spec defines it.
Re: [PATCH 06/13] ASoC: tegra: Add Tegra210 based MVC driver
In reply to Mark BrownQuoted 10 lines · Mark Brown
sound/soc/tegra/tegra210_mvc.c line 211
Quoted 8 lines
sound/soc/tegra/tegra210_mvc.c new file +8
-0+ err |=regmap_update_bits (mvc->regmap,TEGRA210_MVC_SWITCH , +TEGRA210_MVC_VOLUME_SWITCH_MASK , +TEGRA210_MVC_VOLUME_SWITCH_TRIGGER ); + +end: +pm_runtime_put (cmpnt->dev); +return err; +}
_put()should return 0 if there's no change or 1 for a change.
So this means, no need to return any error value and just return 0 in such cases?
Mark Brown
maintainerRe: [PATCH 06/13] ASoC: tegra: Add Tegra210 based MVC driver
Quoted 13 lines · Sameer Pujar
Quoted 10 lines · Mark Brown
sound/soc/tegra/tegra210_mvc.c line 211
Quoted 8 lines
sound/soc/tegra/tegra210_mvc.c new file +8
-0+ err |=regmap_update_bits (mvc->regmap,TEGRA210_MVC_SWITCH , +TEGRA210_MVC_VOLUME_SWITCH_MASK , +TEGRA210_MVC_VOLUME_SWITCH_TRIGGER ); + +end: +pm_runtime_put (cmpnt->dev); +return err; +}
_put()should return 0 if there's no change or 1 for a change.
Quoted 2 lines
So this means, no need to return any error value and just return 0 in such cases?
If there's an error you should return that instead.
Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE
In reply to Sameer PujarQuoted 8 lines · Sameer Pujar
In some cases, multiple FE components have the same BE component in their respective DPCM paths. One such example would be a mixer component, which can receive two or more inputs and sends a mixed output. In such cases, to avoid reconfiguration of already active DAI (mixer output DAI in this case), check the BE stream state to filter out the redundancy.
In summary, allow connection of BE if the respective current stream state is either NEW or CLOSED.
This patch breaks our SOF CI tests, ironically in all cases where we have a mixer with a 'Deep buffer' port! The tests with multiple streams all fail with this error:
[ 124.366400] Port0 Deep Buffer: ASoC: no backend DAIs enabled for Port0 Deep Buffer [ 124.366406] Port0 Deep Buffer: ASoC: dpcm_fe_dai_prepare() failed (-22)
Reverting this patch restore the mixer functionality.
I see multiple problems with this patch:
At a high-level, there's at least a race condition where this BE state is checked without any protection. That was already a problem that I highlighted in a recent RFC and still working on, when we have multiple FEs we can have START/STOP triggers happening concurrently and it's necessary to serialize these triggers when checking the state, and this patch increases the 'surface' for this race condition.
But in addition we'd need to agree on what an 'active BE' is. Why can't we connect a second stream while the first one is already in HW_PARAMS or PAUSED or STOP? It's perfectly legal in ALSA/ASoC to have multiple HW_PARAMS calls, and when we reach STOP we have to do a prepare again.
And more fundamentally, the ability to add a second FE on a 'active' BE in START state is a basic requirement for a mixer, e.g. to play a notification on one FE while listening to music on another. What needs to happen is only to make sure that the FE and BE are compatible in terms of HW_PARAMS and not sending a second TRIGGER_STOP, only checking the BE NEW or CLOSE state is way too restrictive.
I will agree this sort of mixer use cases is not well supported in soc-pcm.c, but let's not make it worse than it was before this patch, shall we?
I can send a revert with the explanations in the commit message if there is a consensus that this patch needs to be revisited.
[1] https://github.com/thesofproject/linux/pull/3177
[2] https://sof-ci.01.org/linuxpr/PR3177/build6440/devicetest/
Quoted 21 lines
Signed-off-by Sameer Pujar <[email protected]>--- sound/soc/soc-pcm.c | 4 ++++ 1 file changed, 4 insertions(+)sound/soc/soc-pcm.c +4
-0@@ -1395,6 +1395,10 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,if (!fe->dpcm[stream].runtime && !fe->fe_compr)continue ; +if ((be->dpcm[stream].state !=SND_SOC_DPCM_STATE_NEW ) && + (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_CLOSE )) +continue ; +/* newly connected FE and BE */ err =dpcm_be_connect (fe, be, stream);if (err <0 ) {
Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE
Quoted 1 line · Pierre-Louis Bossart
On 8/27/21 4:33 AM, Sameer Pujar wrote:
[...]
Quoted 11 lines
But in addition we'd need to agree on what an 'active BE' is. Why can't we connect a second stream while the first one is already in
HW_PARAMSor PAUSED or STOP? It's perfectly legal in ALSA/ASoC to have multipleHW_PARAMScalls, and when we reach STOP we have to do a prepare again.And more fundamentally, the ability to add a second FE on a 'active' BE in START state is a basic requirement for a mixer, e.g. to play a notification on one FE while listening to music on another. What needs to happen is only to make sure that the FE and BE are compatible in terms of
HW_PARAMSand not sending a secondTRIGGER_STOP, only checking the BE NEW or CLOSE state is way too restrictive.
Sorry for the trouble to your system.
Idea was to avoid reconfiguration of the same BE DAI again, but not to stop the provision to add a subsequent FE. In fact I had tested mixing of streams coming from 10 different FEs.
In your case, because of this patch, looks like the subsequent FE is not finding a BE DAI since it is already active due to a prior FE. The reason it works at my end is because the mixer input and output DAIs are separated. Any new FE would just configure the mixer input DAI to which it is attached and skip already running/configured output DAI. I am just curious to know, if originally you were reconfiguring the BE DAI again with same parameters (for a second FE) or some additional configuration is done?
Quoted 2 lines
I can send a revert with the explanations in the commit message if there is a consensus that this patch needs to be revisited.
May be this can be revisited since it appears to be a critical problem for your system. But I hope this discussion can be alive on following points for a better fix.
1. The original issue at my end was not just a configuration redundancy. I realize now that with more stream addition following error print is seen. "ASoC: too many users playback at open 4"
This is because the max DPCM users is capped at 8. Increasing this may help (need to see what number is better), but does not address the redundancy problem.
2. If reconfiguration of the same BE is not necessary for a subsequent FE run, shouldn't we avoid the reconfig itself and somehow avoid FE failure?
Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE
Quoted 25 lines · Sameer Pujar
Quoted 1 line · Pierre-Louis Bossart
On 8/27/21 4:33 AM, Sameer Pujar wrote:
[...]
Quoted 11 lines
But in addition we'd need to agree on what an 'active BE' is. Why can't we connect a second stream while the first one is already in
HW_PARAMSor PAUSED or STOP? It's perfectly legal in ALSA/ASoC to have multipleHW_PARAMScalls, and when we reach STOP we have to do a prepare again.And more fundamentally, the ability to add a second FE on a 'active' BE in START state is a basic requirement for a mixer, e.g. to play a notification on one FE while listening to music on another. What needs to happen is only to make sure that the FE and BE are compatible in terms of
HW_PARAMSand not sending a secondTRIGGER_STOP, only checking the BE NEW or CLOSE state is way too restrictive.Sorry for the trouble to your system.
Idea was to avoid reconfiguration of the same BE DAI again, but not to stop the provision to add a subsequent FE. In fact I had tested mixing of streams coming from 10 different FEs.
Quoted 5 lines
In your case, because of this patch, looks like the subsequent FE is not finding a BE DAI since it is already active due to a prior FE. The reason it works at my end is because the mixer input and output DAIs are separated. Any new FE would just configure the mixer input DAI to which it is attached and skip already running/configured output DAI.
The problem as I see is that with this patch one can not connect a new FE to a BE which is _not_ in NEW or CLOSE state.
The FE and BE needs to be connected to have DPCM working and this patch makes the code to skip the dpcm_be_connect().
Consider this simple setup:
FE1 -->|
| --> BE -->
FE2- ->|First we start FE1, dpcm_be_connect(FE1, BE, stream) is made.
Later FE2 is started but dpcm_be_connect(FE2, BE, stream) would be not made because BE is no longer in NEW/CLOSE state.
Quoted 17 lines
I am just
curious to know, if originally you were reconfiguring the BE DAI again with same parameters (for a second FE) or some additional configuration is done?Quoted 2 lines
I can send a revert with the explanations in the commit message if there is a consensus that this patch needs to be revisited.
May be this can be revisited since it appears to be a critical problem for your system. But I hope this discussion can be alive on following points for a better fix.
1. The original issue at my end was not just a configuration redundancy. I realize now that with more stream addition following error print is seen. "ASoC: too many users playback at open 4"
Quoted 7 lines
This is because the max DPCM users is capped at 8. Increasing this may help (need to see what number is better), but does not address the redundancy problem.
2. If reconfiguration of the same BE is not necessary for a subsequent FE run, shouldn't we avoid the reconfig itself and somehow avoid FE failure?
I'm not sure, but it might be possible to just skip the dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE); call at the end of the loop, but the question is under which condition? Can a BE asked to be reconfigured when STOP/OPEN/HW_PARAMS?
Skipping the connect does not sound right for a new FE-BE connection.
Signature · 1 line
Péter
Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
But in addition we'd need to agree on what an 'active BE' is. Why can't we connect a second stream while the first one is already in
HW_PARAMSor PAUSED or STOP? It's perfectly legal in ALSA/ASoC to have multipleHW_PARAMScalls, and when we reach STOP we have to do a prepare again.And more fundamentally, the ability to add a second FE on a 'active' BE in START state is a basic requirement for a mixer, e.g. to play a notification on one FE while listening to music on another. What needs to happen is only to make sure that the FE and BE are compatible in terms of
HW_PARAMSand not sending a secondTRIGGER_STOP, only checking the BE NEW or CLOSE state is way too restrictive.
Quoted 5 lines
Quoted 5 lines
Sorry for the trouble to your system.
Idea was to avoid reconfiguration of the same BE DAI again, but not to stop the provision to add a subsequent FE. In fact I had tested mixing of streams coming from 10 different FEs.
Can you describe the sequence that you used to start them? That may be useful to understand the criteria you used?
Quoted 5 lines
Quoted 5 lines
In your case, because of this patch, looks like the subsequent FE is not finding a BE DAI since it is already active due to a prior FE. The reason it works at my end is because the mixer input and output DAIs are separated. Any new FE would just configure the mixer input DAI to which it is attached and skip already running/configured output DAI.
If you want to visualize the topology we're using in our 'nocodec' tests, see
and use the sof-adl-nocodec.
it's a bog-standard topology with processing entities connected by buffers.
I don't fully understand the notion of mixer input DAI, in our case we have a bunch of PCM devices connected to a mixer. The mixer is not directly connected to a DAI.
Quoted 8 lines
The problem as I see is that with this patch one can not connect a new FE to a BE which is _not_ in NEW or CLOSE state.
The FE and BE needs to be connected to have DPCM working and this patch makes the code to skip the
dpcm_be_connect().Consider this simple setup:
Quoted 8 lines
FE1 -->| | --> BE --> FE2- ->|First we start FE1,
dpcm_be_connect(FE1, BE, stream)is made.Later FE2 is started but
dpcm_be_connect(FE2, BE, stream)would be not made because BE is no longer in NEW/CLOSE state.
I share Peter's analysis, there cannot be any restrictions on connections - at any time. A mixer input might become active and be added to the mix. We might have a temporary lock to delay new connections but cannot not reject them outright based on BE state.
Quoted 4 lines
Quoted 4 lines
I am just
curious to know, if originally you were reconfiguring the BE DAI again with same parameters (for a second FE) or some additional configuration is done?
That's a different question - and a good one.
In the case of a mixer, the propagation of hw_params is a broken concept. It leads to the first FE configuring the BE to define its preferred parameters, e.g. S16_LE format. If later on a second FE is started which could play S24_LE, the mixer and BE are already configured to a lower resolution. A mixer should really have its own parameters and be the start of a new 'domain' - as Lars described it several years ago at the audio miniconference.
For now, the only restriction that we could enforce is that the BE cannot be reconfigured after the prepare step.
Note that our DAIs tolerate multiple calls to hw_params. If you have a case where the hw_params allocates resources, maybe you should consider moving that allocation to the prepare step, or free them if you detect a reconfiguration. That would be something needed even outside of the DPCM scope. Similarly you need to support the case where the DAI hw_free is called without hw_params ever being called, it's a known sequence that can happen if the FE hw-params fails.
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
I can send a revert with the explanations in the commit message if there is a consensus that this patch needs to be revisited.
May be this can be revisited since it appears to be a critical problem for your system. But I hope this discussion can be alive on following points for a better fix.
Quoted 7 lines
Quoted 7 lines
1. The original issue at my end was not just a configuration redundancy. I realize now that with more stream addition following error print is seen. "ASoC: too many users playback at open 4"
This is because the max DPCM users is capped at 8. Increasing this may help (need to see what number is better), but does not address the redundancy problem.
we haven't used more than 2 users, but it's already broken at 2 with race conditions left and right. I am really surprised you managed to have more than 2 without hitting inconsistent states - our automated play/stop/pause monkey tests reliably break DPCM in less than 20s.
Quoted 10 lines
Quoted 3 lines
2. If reconfiguration of the same BE is not necessary for a subsequent FE run, shouldn't we avoid the reconfig itself and somehow avoid FE failure?
I'm not sure, but it might be possible to just skip the
dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE); call at the end of the loop, but the question is under which condition? Can a BE asked to be reconfigured when STOP/OPEN/HW_PARAMS?Skipping the connect does not sound right for a new FE-BE connection.
The reconfiguration is one problem, but what also happens is that the BE dailink will see multiple triggers. I've been playing with refcounts to force consistency and make sure there is only one TRIGGER_START send to the dailink, and conversely there are cases where the TRIGGER_STOP is never sent...
Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE
Quoted 11 lines · Pierre-Louis Bossart
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
But in addition we'd need to agree on what an 'active BE' is. Why can't we connect a second stream while the first one is already in
HW_PARAMSor PAUSED or STOP? It's perfectly legal in ALSA/ASoC to have multipleHW_PARAMScalls, and when we reach STOP we have to do a prepare again.And more fundamentally, the ability to add a second FE on a 'active' BE in START state is a basic requirement for a mixer, e.g. to play a notification on one FE while listening to music on another. What needs to happen is only to make sure that the FE and BE are compatible in terms of
HW_PARAMSand not sending a secondTRIGGER_STOP, only checking the BE NEW or CLOSE state is way too restrictive.
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Sorry for the trouble to your system.
Idea was to avoid reconfiguration of the same BE DAI again, but not to stop the provision to add a subsequent FE. In fact I had tested mixing of streams coming from 10 different FEs.
Can you describe the sequence that you used to start them? That may be useful to understand the criteria you used?
I have something like this:
FE1 --> Crossbar -> Mixer Input1 |
FE2 --> Crossbar -> Mixer Input2 |
... | --> Mixer Output --> ... |
FE10 --> Crossbar -> Mixer Input10 |
All these FEs are started one after the other. This is an example of 10x1. Similarly we can have 2x1, 3x1 etc.,
In our system, the crossbar [0] and mixer [1] are separate ASoC components. Basically audio paths consist of a group of ASoC components which are connected back to back.
[0] https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/tree/sound/soc/tegra/tegra210_ahub.c
[1] https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/tree/sound/soc/tegra/tegra210_mixer.c
Quoted 1 line
[...]
Quoted 3 lines
I don't fully understand the notion of mixer input DAI, in our case we have a bunch of PCM devices connected to a mixer. The mixer is not directly connected to a DAI.
Please see above mixer example. Since mixer is a separate ASoC component, it exposes 10 inputs (or DAIs) and outputs. Originally what I wanted to do was, for subsequent FE runs (FE2, FE3 ...) mixer output need not be configured again and again.
Quoted 12 lines
Quoted 12 lines
The problem as I see is that with this patch one can not connect a new FE to a BE which is _not_ in NEW or CLOSE state.
The FE and BE needs to be connected to have DPCM working and this patch makes the code to skip the
dpcm_be_connect().Consider this simple setup:
FE1 -->|
| --> BE -->FE2- ->|
Quoted 8 lines
Quoted 4 lines
First we start FE1,
dpcm_be_connect(FE1, BE, stream)is made.Later FE2 is started but
dpcm_be_connect(FE2, BE, stream)would be not made because BE is no longer in NEW/CLOSE state.I share Peter's analysis, there cannot be any restrictions on connections - at any time. A mixer input might become active and be added to the mix. We might have a temporary lock to delay new connections but cannot not reject them outright based on BE state.
Yes, I understand how this affects a system like yours. As per mixer example above, in our case subsequent FEs always find BE from Crossbar. That is why I don't see similar error.
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines
I am just
curious to know, if originally you were reconfiguring the BE DAI again with same parameters (for a second FE) or some additional configuration is done?That's a different question - and a good one.
Quoted 7 lines
In the case of a mixer, the propagation of
hw_paramsis a broken concept. It leads to the first FE configuring the BE to define its preferred parameters, e.g.S16_LEformat. If later on a second FE is started which could playS24_LE, the mixer and BE are already configured to a lower resolution. A mixer should really have its own parameters and be the start of a new 'domain' - as Lars described it several years ago at the audio miniconference.
Propagation is one of the problems we want to address and require help from DPCM experts. But the scenario you mentioned is a special case which need not be supported, because mixer can operate in one configuration at a given time and subsequent FEs should agree to the already running configuration. However mixer should support both S16_LE and S24_LE (whenever possible), but not simultaneously. At least this is the expecation from our systems. Yes mixer may require fixup of a specific config (we earlier had proposed mixer controls to configure mixer parameters, but the idea was disliked), but propagation may help avoid fixing up everywhere in the audio path where it is not really required. But I don't know how this can be done at the moment.
Quoted 11 lines
For now, the only restriction that we could enforce is that the BE cannot be reconfigured after the prepare step.
Note that our DAIs tolerate multiple calls to
hw_params. If you have a case where thehw_paramsallocates resources, maybe you should consider moving that allocation to the prepare step, or free them if you detect a reconfiguration. That would be something needed even outside of the DPCM scope. Similarly you need to support the case where the DAIhw_freeis called withouthw_paramsever being called, it's a known sequence that can happen if the FE hw-params fails.
Currently this does not seem to be a problem for us. Patch was to avoid reconfiguration which was felt to be redundant for our system.
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
I can send a revert with the explanations in the commit message if there is a consensus that this patch needs to be revisited.
May be this can be revisited since it appears to be a critical problem for your system. But I hope this discussion can be alive on following points for a better fix.
1. The original issue at my end was not just a configuration redundancy. I realize now that with more stream addition following error print is seen. "ASoC: too many users playback at open 4"
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
This is because the max DPCM users is capped at 8. Increasing this
may help (need to see what number is better), but does not address the redundancy problem.we haven't used more than 2 users, but it's already broken at 2 with race conditions left and right. I am really surprised you managed to have more than 2 without hitting inconsistent states - our automated play/stop/pause monkey tests reliably break DPCM in less than 20s.
I am not sure what is the exact difference, may be DPCM usage in our case is different from what you have. I have mixer tests for different combinations (2x1, 3x1 ...), which seem to pass. In general, we want to have path like this.
FE -> BE1 -> BE2 -> ... -> BEx
Each BEx could be a mixer, resampler etc., Currently DPCM core sees this as multiple BEs for a given FE and that is why multiple "users" are reported.
In the interim, may be we can have following patch to keep both systems working and keep the discussion going to address the oustanding requirements/issues?
sound/soc/soc-pcm.c +0 -0
@@ -1395,7 +1395,13 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
if (!fe->dpcm[stream].runtime && !fe->fe_compr) continue;
- if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && + /*
+ * Filter for systems with 'component_chaining' enabled. + * This helps to avoid unnecessary re-configuration of an + * already active BE on such systems.
+ */
+ if (fe->card->component_chaining &&
+ (be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) continue;
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
2. If reconfiguration of the same BE is not necessary for a subsequent FE run, shouldn't we avoid the reconfig itself and somehow avoid FE failure?
I'm not sure, but it might be possible to just skip the
dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE); call at the end of the loop, but the question is under which condition? Can a BE asked to be reconfigured when STOP/OPEN/HW_PARAMS?
Quoted 6 lines
Quoted 1 line
Skipping the connect does not sound right for a new FE-BE connection.
The reconfiguration is one problem, but what also happens is that the BE dailink will see multiple triggers. I've been playing with refcounts to force consistency and make sure there is only one
TRIGGER_STARTsend to the dailink, and conversely there are cases where theTRIGGER_STOPis never sent...
Just a thought. FE links have dummy codec DAI and core wants to find a real BE when FE is started. May be don't fail a FE when no back end DAI is found (and/or find if the same BE is already connected to some FE) and the above problem becomes simpler?
Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE
Quoted 31 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
But in addition we'd need to agree on what an 'active BE' is. Why can't
we connect a second stream while the first one is already inHW_PARAMSor PAUSED or STOP? It's perfectly legal in ALSA/ASoC to have multipleHW_PARAMScalls, and when we reach STOP we have to do a prepare again.And more fundamentally, the ability to add a second FE on a 'active' BE
in START state is a basic requirement for a mixer, e.g. to play a notification on one FE while listening to music on another. What needs to happen is only to make sure that the FE and BE are compatible in terms ofHW_PARAMSand not sending a secondTRIGGER_STOP, only checking
the BE NEW or CLOSE state is way too restrictive.Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Sorry for the trouble to your system.
Idea was to avoid reconfiguration of the same BE DAI again, but not to stop the provision to add a subsequent FE. In fact I had tested mixing of streams coming from 10 different FEs.
Can you describe the sequence that you used to start them? That may be useful to understand the criteria you used?
I have something like this:
FE1 --> Crossbar -> Mixer Input1 |
FE2 --> Crossbar -> Mixer Input2 |
... | --> Mixer Output --> ... |
FE10 --> Crossbar -> Mixer Input10 |
Quoted 5 lines
All these FEs are started one after the other. This is an example of 10x1. Similarly we can have 2x1, 3x1 etc.,
In our system, the crossbar [0] and mixer [1] are separate ASoC components. Basically audio paths consist of a group of ASoC components which are connected back to back.
Not following. Can you explain how starting FE1 does not change the state of the mixer output then?
Or is each 'Crossbar' instance a full-blown BE? In that case you have a 1:1 mapping between FE and BE, a *really* simple topology...
Quoted 25 lines
Quoted 3 lines
I don't fully understand the notion of mixer input DAI, in our case we have a bunch of PCM devices connected to a mixer. The mixer is not directly connected to a DAI.
Please see above mixer example. Since mixer is a separate ASoC component, it exposes 10 inputs (or DAIs) and outputs. Originally what I wanted to do was, for subsequent FE runs (FE2, FE3 ...) mixer output need not be configured again and again.
Quoted 16 lines
Quoted 16 lines
The problem as I see is that with this patch one can not connect a new FE to a BE which is _not_ in NEW or CLOSE state.
The FE and BE needs to be connected to have DPCM working and this patch makes the code to skip the
dpcm_be_connect().Consider this simple setup:
FE1 -->|
| --> BE -->
FE2- ->|First we start FE1,
dpcm_be_connect(FE1, BE, stream)is made.Later FE2 is started but
dpcm_be_connect(FE2, BE, stream)would be not made because BE is no longer in NEW/CLOSE state.
Quoted 8 lines
Quoted 4 lines
I share Peter's analysis, there cannot be any restrictions on connections - at any time. A mixer input might become active and be added to the mix. We might have a temporary lock to delay new connections but cannot not reject them outright based on BE state.
Yes, I understand how this affects a system like yours. As per mixer example above, in our case subsequent FEs always find BE from Crossbar. That is why I don't see similar error.
Not following either.
Quoted 14 lines
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines
I am just
curious to know, if originally you were reconfiguring the BE DAI again with same parameters (for a second FE) or some additional configuration is done?That's a different question - and a good one.
Quoted 7 lines
In the case of a mixer, the propagation of
hw_paramsis a broken concept. It leads to the first FE configuring the BE to define its preferred parameters, e.g.S16_LEformat. If later on a second FE is started which could playS24_LE, the mixer and BE are already configured to a lower resolution. A mixer should really have its own parameters and be the start of a new 'domain' - as Lars described it several years ago at the audio miniconference.
Quoted 11 lines
Propagation is one of the problems we want to address and require help from DPCM experts. But the scenario you mentioned is a special case which need not be supported, because mixer can operate in one configuration at a given time and subsequent FEs should agree to the already running configuration. However mixer should support both
S16_LEandS24_LE(whenever possible), but not simultaneously. At least this is the expecation from our systems. Yes mixer may require fixup of a specific config (we earlier had proposed mixer controls to configure mixer parameters, but the idea was disliked), but propagation may help avoid fixing up everywhere in the audio path where it is not really required. But I don't know how this can be done at the moment.
What I am saying is that the mixer should be pre-configured with the desired resolution/sample rate, and some adaptation needs to happen if the FE provides data in a different format.
This is similar to what sound servers typically do on their sinks, they define ONE configuration. Dynamic changes are annoying and result in corner cases where the quality can vary depending on which FE is started first.
Quoted 40 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line
For now, the only restriction that we could enforce is that the BE
cannot be reconfigured after the prepare step.
Note that our DAIs tolerate multiple calls to
hw_params. If you have a case where thehw_paramsallocates resources, maybe you should consider moving that allocation to the prepare step, or free them if you detect a reconfiguration. That would be something needed even outside of the DPCM scope. Similarly you need to support the case where the DAIhw_freeis called withouthw_paramsever being called, it's a known sequence that can happen if the FE hw-params fails.Currently this does not seem to be a problem for us. Patch was to avoid reconfiguration which was felt to be redundant for our system.
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 3 lines
I can send a revert with the explanations in the commit message if there
is a consensus that this patch needs to be revisited.May be this can be revisited since it appears to be a critical problem for your system. But I hope this discussion can be alive on following points for a better fix.
1. The original issue at my end was not just a configuration redundancy.
I realize now that with more stream addition following error print is seen.
"ASoC: too many users playback at open 4"Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
This is because the max DPCM users is capped at 8. Increasing this may help (need to see what number is better), but does not address the redundancy problem.
we haven't used more than 2 users, but it's already broken at 2 with race conditions left and right. I am really surprised you managed to have more than 2 without hitting inconsistent states - our automated play/stop/pause monkey tests reliably break DPCM in less than 20s.
I am not sure what is the exact difference, may be DPCM usage in our case is different from what you have. I have mixer tests for different combinations (2x1, 3x1 ...), which seem to pass. In general, we want to have path like this.
Quoted 5 lines
FE -> BE1 -> BE2 -> ... -> BEx
Each BEx could be a mixer, resampler etc., Currently DPCM core sees this as multiple BEs for a given FE and that is why multiple "users" are reported.
This sort of flow vastly exceeds the capabilities of DPCM, which is already badly broken with one BE and 2 FEs... I think what you want is what Lars described at the audio miniconf with 'domains'.
Quoted 13 lines
In the interim, may be we can have following patch to keep both systems working and keep the discussion going to address the oustanding requirements/issues?
sound/soc/soc-pcm.c +0
-0@@ -1395,7 +1395,13 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, if (!fe->dpcm[stream].runtime && !fe->fe_compr) continue;
sound/soc/soc-pcm.c static int dpcm_add_paths(struct · line 1407
Quoted 10 lines
sound/soc/soc-pcm.c +7
-1- if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && + /* + * Filter for systems with 'component_chaining' enabled. + * This helps to avoid unnecessary re-configuration of an + * already active BE on such systems. + */ + if (fe->card->component_chaining && + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) continue;
that wouldn't work. We need to support the STOP and START cases as well.
Quoted 14 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
2. If reconfiguration of the same BE is not necessary for a subsequent FE run, shouldn't we avoid the reconfig itself and somehow avoid FE failure?
I'm not sure, but it might be possible to just skip the
dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE); call at the end of the loop, but the question is under which condition? Can a BE asked to be reconfigured when STOP/OPEN/HW_PARAMS?Quoted 6 lines
Quoted 1 line
Skipping the connect does not sound right for a new FE-BE connection.
The reconfiguration is one problem, but what also happens is that the BE dailink will see multiple triggers. I've been playing with refcounts to force consistency and make sure there is only one
TRIGGER_STARTsend to the dailink, and conversely there are cases where theTRIGGER_STOPis never sent...
Quoted 4 lines
Just a thought. FE links have dummy codec DAI and core wants to find a real BE when FE is started. May be don't fail a FE when no back end DAI is found (and/or find if the same BE is already connected to some FE) and the above problem becomes simpler?
That would be just moving the problem. In our case we would be silently playing on a dummy output just because the correct output was not found due to state handling issues.
Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE
Quoted 34 lines · Pierre-Louis Bossart
Quoted 26 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
But in addition we'd need to agree on what an 'active BE' is. Why can't
we connect a second stream while the first one is already inHW_PARAMSor PAUSED or STOP? It's perfectly legal in ALSA/ASoC to have multipleHW_PARAMScalls, and when we reach STOP we have to do a prepare again.And more fundamentally, the ability to add a second FE on a 'active' BE
in START state is a basic requirement for a mixer, e.g. to play a notification on one FE while listening to music on another. What needs to happen is only to make sure that the FE and BE are compatible in terms ofHW_PARAMSand not sending a secondTRIGGER_STOP, only checking
the BE NEW or CLOSE state is way too restrictive.Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Sorry for the trouble to your system.
Idea was to avoid reconfiguration of the same BE DAI again, but not to stop the provision to add a subsequent FE. In fact I had tested mixing of streams coming from 10 different FEs.
Can you describe the sequence that you used to start them? That may be useful to understand the criteria you used?
I have something like this:
FE1 --> Crossbar -> Mixer Input1 | FE2 --> Crossbar -> Mixer Input2 | ... | --> Mixer Output -->Quoted 8 lines
... |
FE10 --> Crossbar -> Mixer Input10 |All these FEs are started one after the other. This is an example of 10x1. Similarly we can have 2x1, 3x1 etc.,
In our system, the crossbar [0] and mixer [1] are separate ASoC components. Basically audio paths consist of a group of ASoC components which are connected back to back.
Quoted 5 lines
Not following. Can you explain how starting FE1 does not change the state of the mixer output then?
Or is each 'Crossbar' instance a full-blown BE? In that case you have a 1:1 mapping between FE and BE, a *really* simple topology...
Yes 'Crossbar' exposes multiple ports and it is 1:1 mapping with FE. Starting FE1 does configure mixer output.
Quoted 24 lines
Quoted 24 lines
Quoted 3 lines
I don't fully understand the notion of mixer input DAI, in our case we have a bunch of PCM devices connected to a mixer. The mixer is not directly connected to a DAI.
Please see above mixer example. Since mixer is a separate ASoC component, it exposes 10 inputs (or DAIs) and outputs. Originally what I wanted to do was, for subsequent FE runs (FE2, FE3 ...) mixer output need not be configured again and again.
Quoted 16 lines
Quoted 16 lines
The problem as I see is that with this patch one can not connect a new FE to a BE which is _not_ in NEW or CLOSE state.
The FE and BE needs to be connected to have DPCM working and this patch makes the code to skip the
dpcm_be_connect().Consider this simple setup:
FE1 -->|
| --> BE -->FE2- ->|
First we start FE1,
dpcm_be_connect(FE1, BE, stream)is made.Later FE2 is started but
dpcm_be_connect(FE2, BE, stream)would be not made because BE is no longer in NEW/CLOSE state.
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
I share Peter's analysis, there cannot be any restrictions on connections - at any time. A mixer input might become active and be added to the mix. We might have a temporary lock to delay new connections but cannot not reject them outright based on BE state.
Yes, I understand how this affects a system like yours. As per mixer example above, in our case subsequent FEs always find BE from Crossbar. That is why I don't see similar error.
Not following either.
May be it is understandable now with above crossbar point?
Quoted 24 lines
Quoted 13 lines
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines
I am just
curious to know, if originally you were reconfiguring the BE DAI again with same parameters (for a second FE) or some additional configuration is done?That's a different question - and a good one.
Quoted 7 lines
In the case of a mixer, the propagation of
hw_paramsis a broken concept. It leads to the first FE configuring the BE to define its preferred parameters, e.g.S16_LEformat. If later on a second FE is started which could playS24_LE, the mixer and BE are already configured to a lower resolution. A mixer should really have its own parameters and be the start of a new 'domain' - as Lars described it several years ago at the audio miniconference.Quoted 11 lines
Propagation is one of the problems we want to address and require help from DPCM experts. But the scenario you mentioned is a special case which need not be supported, because mixer can operate in one configuration at a given time and subsequent FEs should agree to the already running configuration. However mixer should support both
S16_LEandS24_LE(whenever possible), but not simultaneously. At least this is the expecation from our systems. Yes mixer may require fixup of a specific config (we earlier had proposed mixer controls to configure mixer parameters, but the idea was disliked), but propagation may help avoid fixing up everywhere in the audio path where it is not really required. But I don't know how this can be done at the moment.
Quoted 8 lines
What I am saying is that the mixer should be pre-configured with the desired resolution/sample rate, and some adaptation needs to happen if the FE provides data in a different format.
This is similar to what sound servers typically do on their sinks, they define ONE configuration. Dynamic changes are annoying and result in corner cases where the quality can vary depending on which FE is started first.
When there are multiple FEs running, yes it is better to run on a pre-agreed configuration to minimize the side effects of race between FEs. Also there should also be a provision where mixer params directly depend on FEs. For example, a 2x1 mixer can mix two 16-bit streams at one time and the other time it can mix two 32-bit streams.
[...]
Quoted 25 lines
Quoted 25 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 3 lines
I can send a revert with the explanations in the commit message if there
is a consensus that this patch needs to be revisited.May be this can be revisited since it appears to be a critical problem for your system. But I hope this discussion can be alive on following points for a better fix.
1. The original issue at my end was not just a configuration redundancy.
I realize now that with more stream addition following error print is seen.
"ASoC: too many users playback at open 4"Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
This is because the max DPCM users is capped at 8. Increasing this
may help (need to see what number is better), but does not address the redundancy problem.we haven't used more than 2 users, but it's already broken at 2 with race conditions left and right. I am really surprised you managed to have more than 2 without hitting inconsistent states - our automated play/stop/pause monkey tests reliably break DPCM in less than 20s.
I am not sure what is the exact difference, may be DPCM usage in our case is different from what you have. I have mixer tests for different combinations (2x1, 3x1 ...), which seem to pass. In general, we want to have path like this.
Quoted 8 lines
Quoted 5 lines
FE -> BE1 -> BE2 -> ... -> BEx
Each BEx could be a mixer, resampler etc., Currently DPCM core sees this as multiple BEs for a given FE and that is why multiple "users" are reported.
This sort of flow vastly exceeds the capabilities of DPCM, which is already badly broken with one BE and 2 FEs... I think what you want is what Lars described at the audio miniconf with 'domains'.
May be the core would require enhancements to fully support such scheme. But so far the system is running well for below path:
FE -> BE1 (crossbar) -> BE2 (I2S) -> BE3 (external codec)
I could introduce more BEs like resampler or mixer in the path and results seem to be good.
BTW, I don't know what 'domains' mean. I will be curious to know what this exactly is. If someone is already using it, a usage reference can help.
Quoted 13 lines
Quoted 13 lines
In the interim, may be we can have following patch to keep both systems working and keep the discussion going to address the oustanding requirements/issues?
sound/soc/soc-pcm.c +0
-0@@ -1395,7 +1395,13 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, if (!fe->dpcm[stream].runtime && !fe->fe_compr) continue;
Quoted 12 lines
sound/soc/soc-pcm.c static int dpcm_add_paths(struct · line 1407
Quoted 10 lines
sound/soc/soc-pcm.c +7
-1-if ((be->dpcm[stream].state !=SND_SOC_DPCM_STATE_NEW ) && +/* +* Filter for systems with 'component_chaining' enabled. +* This helps to avoid unnecessary re-configuration of an +* already active BE on such systems. +*/ +if (fe->card->component_chaining && + (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_NEW ) && (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_CLOSE ))continue ;that wouldn't work. We need to support the STOP and START cases as well.
I meant with flag 'fe->card->component_chaining', which is currently used by Tegra audio only.
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 9 lines
Quoted 3 lines
2. If reconfiguration of the same BE is not necessary for a subsequent FE run, shouldn't we avoid the reconfig itself and somehow avoid FE failure?
I'm not sure, but it might be possible to just skip the
dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE); call at the end of the loop, but the question is under which condition? Can a BE asked to be reconfigured when STOP/OPEN/HW_PARAMS?Skipping the connect does not sound right for a new FE-BE connection.
The reconfiguration is one problem, but what also happens is that the BE dailink will see multiple triggers. I've been playing with refcounts to force consistency and make sure there is only one
TRIGGER_STARTsend to the dailink, and conversely there are cases where theTRIGGER_STOPis never sent...
Quoted 7 lines
Quoted 4 lines
Just a thought. FE links have dummy codec DAI and core wants to find a real BE when FE is started. May be don't fail a FE when no back end DAI is found (and/or find if the same BE is already connected to some FE) and the above problem becomes simpler?
That would be just moving the problem. In our case we would be silently playing on a dummy output just because the correct output was not found due to state handling issues.
OK. In our case, application would report error since the frames would never get consumed for given FE due to unavailable BE.
Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 3 lines
Can you describe the sequence that you used to start them? That may be useful to understand the criteria you used?
I have something like this:
FE1 --> Crossbar -> Mixer Input1 |
FE2 --> Crossbar -> Mixer Input2 |
... | --> Mixer Output --> ... |
FE10 --> Crossbar -> Mixer Input10 |All these FEs are started one after the other. This is an example of 10x1. Similarly we can have 2x1, 3x1 etc.,
In our system, the crossbar [0] and mixer [1] are separate ASoC components. Basically audio paths consist of a group of ASoC components which are connected back to back.
Quoted 8 lines
Quoted 5 lines
Not following. Can you explain how starting FE1 does not change the state of the mixer output then?
Or is each 'Crossbar' instance a full-blown BE? In that case you have a 1:1 mapping between FE and BE, a *really* simple topology...
Yes 'Crossbar' exposes multiple ports and it is 1:1 mapping with FE. Starting FE1 does configure mixer output.
Ah ok, now I get the difference with the N:1 topology we used. Thanks for explaining this.
Quoted 30 lines
Quoted 13 lines
Quoted 13 lines
In the interim, may be we can have following patch to keep both systems working and keep the discussion going to address the oustanding requirements/issues?
sound/soc/soc-pcm.c +0
-0@@ -1395,7 +1395,13 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, if (!fe->dpcm[stream].runtime && !fe->fe_compr) continue;Quoted 16 lines
Quoted 6 lines
sound/soc/soc-pcm.c +0
-1- if ((be->dpcm[stream].state !=
SND_SOC_DPCM_STATE_NEW) &&
+ /*
+ * Filter for systems with 'component_chaining' enabled. + * This helps to avoid unnecessary re-configuration of anQuoted 8 lines
+ * already active BE on such systems. + */
+ if (fe->card->component_chaining&& + (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_NEW) && (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_CLOSE))
continue;that wouldn't work. We need to support the STOP and START cases as well.
Quoted 2 lines
I meant with flag '
fe->card->component_chaining', which is currently used by Tegra audio only.
Ah yes, this may be a temporary solution that gets us both back to a 'working solution'. Let me give it a try.
Good discussion, thanks!
-Pierre
Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE
In reply to Sameer PujarQuoted 8 lines
1. The original issue at my end was not just a configuration redundancy. I realize now that with more stream addition following error print is seen. "ASoC: too many users playback at open 4"
This is because the max DPCM users is capped at 8. Increasing this may help (need to see what number is better), but does not address the redundancy problem.
Going back to this DPCM_MAX_BE_USERS definition, it seems rather arbitrary and not so useful indeed.
/* first time the dpcm is open ? */
if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) {
dev_err(be->dev, "ASoC: too many users %s at open %d\n",
stream ? "capture" : "playback",
be->dpcm[stream].state);
continue;
}The comment is no longer aligned with the code, wondering if this is a feature or a bug. There's no reason to arbitrarily restrict the number of users of a BE, or the check would need to use platform-specific information such as the number of inputs/outputs supported by a mixer/demux.
Maybe Morimoto-san can comment since this was added in:
1db19c151819 ('ASoC: soc-pcm: fixup dpcm_be_dai_startup() user count')
We're not done with soc-pcm.c cleanups :-)
Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE
Quoted 18 lines · Pierre-Louis Bossart
Quoted 7 lines
1. The original issue at my end was not just a configuration redundancy. I realize now that with more stream addition following error print is seen. "ASoC: too many users playback at open 4"
This is because the max DPCM users is capped at 8. Increasing this
may help (need to see what number is better), but does not address the redundancy problem.Going back to this
DPCM_MAX_BE_USERSdefinition, it seems rather arbitrary and not so useful indeed./* first time the dpcm is open ? */ if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) { dev_err(be->dev, "ASoC: too many users %s at open %d\n", stream ? "capture" : "playback", be->dpcm[stream].state); continue; }
Quoted 2 lines
The comment is no longer aligned with the code, wondering if this is a feature or a bug.
Looks like the comment is misplaced and the intention might have been to place it like below?
sound/soc/soc-pcm.c +0 -0
@@ -1508,7 +1508,6 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream)
if (!snd_soc_dpcm_be_can_update(fe, be, stream)) continue;
- /* first time the dpcm is open ? */
if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) { dev_err(be->dev, "ASoC: too many users %s at open %d\n", stream ? "capture" : "playback",
@@ -1516,6 +1515,7 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) continue;
}
+ /* first time the dpcm is open ? */ if (be->dpcm[stream].users++ != 0) continue;
Quoted 9 lines
There's no reason to arbitrarily restrict the number
of users of a BE, or the check would need to use platform-specific information such as the number of inputs/outputs supported by a mixer/demux.Maybe Morimoto-san can comment since this was added in:
1db19c151819('ASoC: soc-pcm: fixupdpcm_be_dai_startup()user count')We're not done with
soc-pcm.ccleanups :-)