mbox series

[v4,00/15] Audio graph card updates and usage with Tegra210 audio

Message ID 1602859382-19505-1-git-send-email-spujar@nvidia.com
Headers show
Series Audio graph card updates and usage with Tegra210 audio | expand

Message

Sameer Pujar Oct. 16, 2020, 2:42 p.m. UTC
Summary of changes:
 * Support multiple instances of a component. For example there can be
   multiple I2S devices which can use the same component driver.

 * Support open platforms with empty Codec endpoint. Customers can plug
   their own HW and can populate codec endpoint.

 * In a component model there can be many components which can be
   connected togethe. In such cases Identify no-pcm DPCM DAI links which
   can be used in BE<->BE connections.

 * Add Tegra audio graph driver which is based on generic audio graph
   driver and specific customizations are done in Tegra driver.

 * This pushes DT support for Tegra210 based platforms which uses
   audio-graph card and above enhancements.

The series is based on following references where DPCM usgae for Tegra
Audio and simple-card driver proposal were discussed.

 * https://lkml.org/lkml/2020/4/30/519 (DPCM for Tegra)
 * https://lkml.org/lkml/2020/6/27/4 (simple-card driver)

Changelog
=========

v3 -> v4
--------
 * Added new patches to convert graph.txt and audio-graph-card.txt
   to corresponding json-schema files. Later these references
   are used in Tegra audio graph schema.

 * AHUB component binding docs are updated to reflect the usage
   of ports/port/endpoint

 * More common stuff is moved into graph_parse_of() and this is
   used by both generic and Tegra audio graph.

 * DT binding for Tegra audio graph is updated to included "ports { }"

 * As per the suggestion 'void *data' member is dropped from
   'asoc_simple_priv' and instead container method is used to
   maintain required custom data internal to Tegra audio graph. 

v2 -> v3
--------
 * Dropped new compatible addition in generic graph driver
   after reviewing it with Morimoto-san. Instead added Tegra
   audio graph driver and new compatibles are added in the same.
 * Added new patches to expose new members for customization
   in audio graph driver.
 * Added new patch for Tegra audio graph driver and related
   documentation.
 * Minor change in below commit where mutex version of helper is used
   "ASoC: audio-graph: Identify 'no_pcm' DAI links for DPCM"
 * DT binding is updated to use the newly exposed compatibles
 * No changes in other patches

v1 -> v2
--------
 * Re-organized ports/endpoints description for ADMAIF and XBAR.
   Updated DT patches accordingly.
 * After above change, multiple Codec endpoint support is not
   required and hence dropped for now. This will be considered
   separately if at all required in future.
 * Re-ordered patches in the series.

Sameer Pujar (15):
  ASoC: soc-core: Fix component name_prefix parsing
  ASoC: soc-pcm: Get all BEs along DAPM path
  ASoC: audio-graph: Use of_node and DAI for DPCM DAI link names
  ASoC: audio-graph: Identify 'no_pcm' DAI links for DPCM
  ASoC: audio-graph: Support empty Codec endpoint
  ASoC: audio-graph: Expose new members for asoc_simple_priv
  ASoC: audio-graph: Expose helpers from audio graph
  Documentation: of: Convert graph bindings to json-schema
  ASoC: dt-bindings: audio-graph: Convert bindings to json-schema
  ASoC: dt-bindings: tegra: Add graph bindings
  ASoC: dt-bindings: tegra: Add json-schema for Tegra audio graph card
  ASoC: tegra: Add audio graph based card driver
  arm64: defconfig: Enable Tegra audio graph card driver
  arm64: tegra: Audio graph header for Tegra210
  arm64: tegra: Audio graph sound card for Jetson Nano and TX1

 Documentation/devicetree/bindings/graph.txt        | 128 -----
 Documentation/devicetree/bindings/graph.yaml       | 170 +++++++
 .../devicetree/bindings/sound/audio-graph-card.txt | 337 -------------
 .../bindings/sound/audio-graph-card.yaml           | 548 +++++++++++++++++++++
 .../sound/nvidia,tegra-audio-graph-card.yaml       | 158 ++++++
 .../bindings/sound/nvidia,tegra186-dspk.yaml       |   7 +
 .../bindings/sound/nvidia,tegra210-admaif.yaml     |   7 +
 .../bindings/sound/nvidia,tegra210-ahub.yaml       |   7 +
 .../bindings/sound/nvidia,tegra210-dmic.yaml       |   7 +
 .../bindings/sound/nvidia,tegra210-i2s.yaml        |   7 +
 .../boot/dts/nvidia/tegra210-audio-graph.dtsi      | 153 ++++++
 arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 262 ++++++++++
 arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 146 ++++++
 arch/arm64/configs/defconfig                       |   1 +
 include/sound/graph_card.h                         |  16 +
 include/sound/simple_card_utils.h                  |   3 +
 include/sound/soc.h                                |   1 +
 sound/soc/generic/audio-graph-card.c               | 175 ++++---
 sound/soc/soc-core.c                               |   3 +-
 sound/soc/soc-pcm.c                                |   3 +-
 sound/soc/tegra/Kconfig                            |   9 +
 sound/soc/tegra/Makefile                           |   2 +
 sound/soc/tegra/tegra_audio_graph_card.c           | 255 ++++++++++
 23 files changed, 1882 insertions(+), 523 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/graph.txt
 create mode 100644 Documentation/devicetree/bindings/graph.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/audio-graph-card.txt
 create mode 100644 Documentation/devicetree/bindings/sound/audio-graph-card.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml
 create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-audio-graph.dtsi
 create mode 100644 include/sound/graph_card.h
 create mode 100644 sound/soc/tegra/tegra_audio_graph_card.c

Comments

Kuninori Morimoto Oct. 19, 2020, 2:50 a.m. UTC | #1
Hi Sameer


> Convert device tree bindings of audio graph card to YAML format. Also
> expose some common definitions which can be used by similar graph based
> audio sound cards.
> 
> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---

I'm posting this patch to Rob & DT ML.
Not yet accepted, though..

>  .../devicetree/bindings/sound/audio-graph-card.txt | 337 -------------
>  .../bindings/sound/audio-graph-card.yaml           | 548 +++++++++++++++++++++
>  2 files changed, 548 insertions(+), 337 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/sound/audio-graph-card.txt
>  create mode 100644 Documentation/devicetree/bindings/sound/audio-graph-card.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/audio-graph-card.txt b/Documentation/devicetree/bindings/sound/audio-graph-card.txt
> deleted file mode 100644
> index d5f6919..0000000
> --- a/Documentation/devicetree/bindings/sound/audio-graph-card.txt
> +++ /dev/null
> @@ -1,337 +0,0 @@
> -Audio Graph Card:
> -
> -Audio Graph Card specifies audio DAI connections of SoC <-> codec.
> -It is based on common bindings for device graphs.
> -see ${LINUX}/Documentation/devicetree/bindings/graph.txt
> -
> -Basically, Audio Graph Card property is same as Simple Card.
> -see ${LINUX}/Documentation/devicetree/bindings/sound/simple-card.yaml
> -
> -Below are same as Simple-Card.
> -
> -- label
> -- widgets
> -- routing
> -- dai-format
> -- frame-master
> -- bitclock-master
> -- bitclock-inversion
> -- frame-inversion
> -- mclk-fs
> -- hp-det-gpio
> -- mic-det-gpio
> -- dai-tdm-slot-num
> -- dai-tdm-slot-width
> -- clocks / system-clock-frequency
> -
> -Required properties:
> -
> -- compatible				: "audio-graph-card";
> -- dais					: list of CPU DAI port{s}
> -
> -Optional properties:
> -- pa-gpios: GPIO used to control external amplifier.
> -
> ------------------------
> -Example: Single DAI case
> ------------------------
> -
> -	sound_card {
> -		compatible = "audio-graph-card";
> -
> -		dais = <&cpu_port>;
> -	};
> -
> -	dai-controller {
> -		...
> -		cpu_port: port {
> -			cpu_endpoint: endpoint {
> -				remote-endpoint = <&codec_endpoint>;
> -
> -				dai-format = "left_j";
> -				...
> -			};
> -		};
> -	};
> -
> -	audio-codec {
> -		...
> -		port {
> -			codec_endpoint: endpoint {
> -				remote-endpoint = <&cpu_endpoint>;
> -			};
> -		};
> -	};
> -
> ------------------------
> -Example: Multi DAI case
> ------------------------
> -
> -	sound-card {
> -		compatible = "audio-graph-card";
> -
> -		label = "sound-card";
> -
> -		dais = <&cpu_port0
> -			&cpu_port1
> -			&cpu_port2>;
> -	};
> -
> -	audio-codec@0 {
> -		...
> -		port {
> -			codec0_endpoint: endpoint {
> -				remote-endpoint = <&cpu_endpoint0>;
> -			};
> -		};
> -	};
> -
> -	audio-codec@1 {
> -		...
> -		port {
> -			codec1_endpoint: endpoint {
> -				remote-endpoint = <&cpu_endpoint1>;
> -			};
> -		};
> -	};
> -
> -	audio-codec@2 {
> -		...
> -		port {
> -			codec2_endpoint: endpoint {
> -				remote-endpoint = <&cpu_endpoint2>;
> -			};
> -		};
> -	};
> -
> -	dai-controller {
> -		...
> -		ports {
> -			cpu_port0: port@0 {
> -				cpu_endpoint0: endpoint {
> -					remote-endpoint = <&codec0_endpoint>;
> -
> -					dai-format = "left_j";
> -					...
> -				};
> -			};
> -			cpu_port1: port@1 {
> -				cpu_endpoint1: endpoint {
> -					remote-endpoint = <&codec1_endpoint>;
> -
> -					dai-format = "i2s";
> -					...
> -				};
> -			};
> -			cpu_port2: port@2 {
> -				cpu_endpoint2: endpoint {
> -					remote-endpoint = <&codec2_endpoint>;
> -
> -					dai-format = "i2s";
> -					...
> -				};
> -			};
> -		};
> -	};
> -
> -
> ------------------------
> -Example: Sampling Rate Conversion
> ------------------------
> -
> -	sound_card {
> -		compatible = "audio-graph-card";
> -
> -		label = "sound-card";
> -		prefix = "codec";
> -		routing = "codec Playback", "DAI0 Playback",
> -			  "DAI0 Capture",   "codec Capture";
> -		convert-rate = <48000>;
> -
> -		dais = <&cpu_port>;
> -	};
> -
> -	audio-codec {
> -		...
> -		port {
> -			codec_endpoint: endpoint {
> -				remote-endpoint = <&cpu_endpoint>;
> -			};
> -		};
> -	};
> -
> -	dai-controller {
> -		...
> -		cpu_port: port {
> -			cpu_endpoint: endpoint {
> -				remote-endpoint = <&codec_endpoint>;
> -
> -				dai-format = "left_j";
> -				...
> -			};
> -		};
> -	};
> -
> ------------------------
> -Example: 2 CPU 1 Codec (Mixing)
> ------------------------
> -
> -	sound_card {
> -		compatible = "audio-graph-card";
> -
> -		label = "sound-card";
> -		routing = "codec Playback", "DAI0 Playback",
> -			  "codec Playback", "DAI1 Playback",
> -			  "DAI0 Capture",   "codec Capture";
> -
> -		dais = <&cpu_port>;
> -	};
> -
> -	audio-codec {
> -		...
> -
> -		audio-graph-card,prefix = "codec";
> -		audio-graph-card,convert-rate = <48000>;
> -		port {
> -			reg = <0>;
> -			codec_endpoint0: endpoint@0 {
> -				remote-endpoint = <&cpu_endpoint0>;
> -			};
> -			codec_endpoint1: endpoint@1 {
> -				remote-endpoint = <&cpu_endpoint1>;
> -			};
> -		};
> -	};
> -
> -	dai-controller {
> -		...
> -		cpu_port: port {
> -			cpu_endpoint0: endpoint@0 {
> -				remote-endpoint = <&codec_endpoint0>;
> -
> -				dai-format = "left_j";
> -				...
> -			};
> -			cpu_endpoint1: endpoint@1 {
> -				remote-endpoint = <&codec_endpoint1>;
> -
> -				dai-format = "left_j";
> -				...
> -			};
> -		};
> -	};
> -
> ------------------------
> -Example: Multi DAI with DPCM
> ------------------------
> -
> -	CPU0 ------ ak4613
> -	CPU1 ------ HDMI
> -	CPU2 ------ PCM3168A-p	/* DPCM 1ch/2ch */
> -	CPU3 --/		/* DPCM 3ch/4ch */
> -	CPU4 --/		/* DPCM 5ch/6ch */
> -	CPU5 --/		/* DPCM 7ch/8ch */
> -	CPU6 ------ PCM3168A-c
> -
> -	sound_card: sound {
> -		compatible = "audio-graph-card";
> -
> -		label = "sound-card";
> -
> -		routing =	"pcm3168a Playback", "DAI2 Playback",
> -				"pcm3168a Playback", "DAI3 Playback",
> -				"pcm3168a Playback", "DAI4 Playback",
> -				"pcm3168a Playback", "DAI5 Playback";
> -
> -		dais = <&snd_port0	/* ak4613 */
> -			&snd_port1	/* HDMI0  */
> -			&snd_port2	/* pcm3168a playback */
> -			&snd_port3	/* pcm3168a capture  */
> -			>;
> -	};
> -
> -	ak4613: codec@10 {
> -		...
> -		port {
> -			ak4613_endpoint: endpoint {
> -				remote-endpoint = <&rsnd_endpoint0>;
> -			};
> -		};
> -	};
> -
> -	pcm3168a: audio-codec@44 {
> -		...
> -		audio-graph-card,prefix = "pcm3168a";
> -		audio-graph-card,convert-channels = <8>; /* TDM Split */
> -		ports {
> -			port@0 {
> -				reg = <0>;
> -				pcm3168a_endpoint_p1: endpoint@1 {
> -					remote-endpoint = <&rsnd_endpoint2>;
> -					...
> -				};
> -				pcm3168a_endpoint_p2: endpoint@2 {
> -					remote-endpoint = <&rsnd_endpoint3>;
> -					...
> -				};
> -				pcm3168a_endpoint_p3: endpoint@3 {
> -					remote-endpoint = <&rsnd_endpoint4>;
> -					...
> -				};
> -				pcm3168a_endpoint_p4: endpoint@4 {
> -					remote-endpoint = <&rsnd_endpoint5>;
> -					...
> -				};
> -			};
> -			port@1 {
> -				reg = <1>;
> -				pcm3168a_endpoint_c: endpoint {
> -					remote-endpoint = <&rsnd_endpoint6>;
> -					...
> -				};
> -			};
> -		};
> -	};
> -
> -	&sound {
> -		ports {
> -			snd_port0: port@0 {
> -				rsnd_endpoint0: endpoint {
> -					remote-endpoint = <&ak4613_endpoint>;
> -					...
> -				};
> -			};
> -			snd_port1: port@1 {
> -				rsnd_endpoint1: endpoint {
> -					remote-endpoint = <&dw_hdmi0_snd_in>;
> -					...
> -				};
> -			};
> -			snd_port2: port@2 {
> -				#address-cells = <1>;
> -				#size-cells = <0>;
> -				rsnd_endpoint2: endpoint@2 {
> -					remote-endpoint = <&pcm3168a_endpoint_p1>;
> -					...
> -				};
> -				rsnd_endpoint3: endpoint@3 {
> -					remote-endpoint = <&pcm3168a_endpoint_p2>;
> -					...
> -				};
> -				rsnd_endpoint4: endpoint@4 {
> -					remote-endpoint = <&pcm3168a_endpoint_p3>;
> -					...
> -				};
> -				rsnd_endpoint5: endpoint@5 {
> -					remote-endpoint = <&pcm3168a_endpoint_p4>;
> -					...
> -				};
> -			};
> -			snd_port3: port@6 {
> -				rsnd_endpoint6: endpoint {
> -					remote-endpoint = <&pcm3168a_endpoint_c>;
> -					...
> -				};
> -			};
> -		};
> -	};
> diff --git a/Documentation/devicetree/bindings/sound/audio-graph-card.yaml b/Documentation/devicetree/bindings/sound/audio-graph-card.yaml
> new file mode 100644
> index 0000000..d4b56bd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/audio-graph-card.yaml
> @@ -0,0 +1,548 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/audio-graph-card.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Generic audio graph card
> +
> +description: |
> +  Audio Graph Card specifies audio DAI connections of SoC <-> codec.
> +  It is based on common bindings for device graphs.
> +  see ${LINUX}/Documentation/devicetree/bindings/graph.yaml
> +
> +  Basically, Audio Graph Card properties are similar to Simple Card.
> +  see ${LINUX}/Documentation/devicetree/bindings/sound/simple-card.yaml
> +  Common definitions required here are referenced from above.
> +
> +maintainers:
> +  - Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> +
> +definitions:
> +
> +  end-point:
> +    type: object
> +    properties:
> +      mclk-fs:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/mclk-fs
> +
> +      prefix:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/prefix
> +
> +      convert-rate:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/convert-rate
> +
> +      convert-channels:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/convert-channels
> +
> +      frame-inversion:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/frame-inversion
> +
> +      bitclock-inversion:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/bitclock-inversion
> +
> +      frame-master:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/frame-master
> +
> +      bitclock-master:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/bitclock-master
> +
> +      dai-tdm-slot-num:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/dai-tdm-slot-num
> +
> +      dai-tdm-slot-width:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/dai-tdm-slot-width
> +
> +      clocks:
> +        maxItems: 1
> +
> +      system-clock-frequency:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/system-clock-frequency
> +
> +      system-clock-direction-out:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/system-clock-direction-out
> +
> +      dai-format:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/format
> +
> +      remote-endpoint:
> +        description: phandle to an 'endpoint' subnode of a remote device node.
> +        $ref: /schemas/types.yaml#/definitions/phandle
> +
> +  port:
> +    type: object
> +    description: |
> +      If there is more than one 'port' or more than one 'endpoint' node
> +      or 'reg' property present in the port and/or endpoint nodes then
> +      '#address-cells' and '#size-cells' properties are required in relevant
> +      parent node.
> +    properties:
> +      convert-rate:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/convert-rate
> +
> +      convert-channels:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/convert-channels
> +
> +      prefix:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/prefix
> +
> +      mclk-fs:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/mclk-fs
> +
> +    patternProperties:
> +      "^endpoint(@[0-9a-f]+)?$":
> +        type: object
> +        $ref: "#/definitions/end-point"
> +
> +  ports:
> +    type: object
> +    properties:
> +      convert-rate:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/convert-rate
> +
> +      convert-channels:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/convert-channels
> +
> +      prefix:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/prefix
> +
> +      mclk-fs:
> +        $ref: /schemas/sound/simple-card.yaml#/definitions/mclk-fs
> +
> +    patternProperties:
> +      "^port(@[0-9a-f]+)?$":
> +        $ref: "#/definitions/port"
> +
> +properties:
> +  compatible:
> +    items:
> +      - const: audio-graph-card
> +
> +  dais:
> +    description: list of CPU DAI port{s}
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +
> +  label:
> +    $ref: /schemas/sound/simple-card.yaml#/definitions/label
> +
> +  pa-gpios:
> +    description: GPIO used to control external amplifier.
> +
> +  widgets:
> +    $ref: /schemas/sound/simple-card.yaml#/definitions/widgets
> +
> +  routing:
> +    $ref: /schemas/sound/simple-card.yaml#/definitions/routing
> +
> +  convert-rate:
> +    $ref: /schemas/sound/simple-card.yaml#/definitions/convert-rate
> +
> +  convert-channels:
> +    $ref: /schemas/sound/simple-card.yaml#/definitions/convert-channels
> +
> +  mclk-fs:
> +    $ref: /schemas/sound/simple-card.yaml#/definitions/mclk-fs
> +
> +  prefix:
> +    $ref: /schemas/sound/simple-card.yaml#/definitions/prefix
> +
> +  hp-det-gpio:
> +    maxItems: 1
> +
> +  mic-det-gpio:
> +    maxItems: 1
> +
> +  ports:
> +    $ref: "#/definitions/ports"
> +
> +patternProperties:
> +  "^port(@[0-9a-f]+)?$":
> +    $ref: "#/definitions/port"
> +
> +required:
> +  - compatible
> +  - dais
> +
> +additionalProperties: false
> +
> +examples:
> +  # ---------------
> +  # Single DAI case
> +  # ---------------
> +  - |
> +    sound_card {
> +        compatible = "audio-graph-card";
> +
> +        dais = <&cpu_port>;
> +    };
> +
> +    dai-controller {
> +        // ...
> +
> +        cpu_port: port {
> +            cpu_endpoint: endpoint {
> +                remote-endpoint = <&codec_endpoint>;
> +
> +                dai-format = "left_j";
> +
> +                // ...
> +            };
> +        };
> +    };
> +
> +    audio-codec {
> +        // ...
> +
> +        port {
> +            codec_endpoint: endpoint {
> +                remote-endpoint = <&cpu_endpoint>;
> +            };
> +        };
> +    };
> +
> +  # --------------
> +  # Multi DAI case
> +  # --------------
> +  - |
> +    sound-card {
> +        compatible = "audio-graph-card";
> +
> +        label = "sound-card";
> +
> +        dais = <&cpu_port0
> +                &cpu_port1
> +                &cpu_port2>;
> +    };
> +
> +    audio-codec-0 {
> +        // ...
> +
> +        port {
> +            codec0_endpoint: endpoint {
> +                remote-endpoint = <&cpu_endpoint0>;
> +            };
> +        };
> +    };
> +
> +    audio-codec-1 {
> +        // ...
> +
> +        port {
> +            codec1_endpoint: endpoint {
> +                remote-endpoint = <&cpu_endpoint1>;
> +            };
> +        };
> +    };
> +
> +    audio-codec-2 {
> +        // ...
> +
> +        port {
> +            codec2_endpoint: endpoint {
> +                remote-endpoint = <&cpu_endpoint2>;
> +            };
> +        };
> +    };
> +
> +    dai-controller {
> +        // ...
> +
> +        ports {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            cpu_port0: port@0 {
> +                reg = <0>;
> +
> +                cpu_endpoint0: endpoint {
> +                    remote-endpoint = <&codec0_endpoint>;
> +
> +                    dai-format = "left_j";
> +
> +                    // ...
> +                };
> +            };
> +            cpu_port1: port@1 {
> +                reg = <1>;
> +
> +                cpu_endpoint1: endpoint {
> +                    remote-endpoint = <&codec1_endpoint>;
> +
> +                    dai-format = "i2s";
> +
> +                    // ...
> +                };
> +            };
> +            cpu_port2: port@2 {
> +                reg = <2>;
> +
> +                cpu_endpoint2: endpoint {
> +                    remote-endpoint = <&codec2_endpoint>;
> +
> +                    dai-format = "i2s";
> +
> +                    // ...
> +                };
> +            };
> +        };
> +    };
> +
> +  # ------------------------
> +  # Sampling Rate Conversion
> +  # ------------------------
> +  - |
> +    sound_card {
> +        compatible = "audio-graph-card";
> +
> +        label = "sound-card";
> +        prefix = "codec";
> +        routing = "codec Playback", "DAI0 Playback",
> +                  "DAI0 Capture",   "codec Capture";
> +        convert-rate = <48000>;
> +
> +        dais = <&cpu_port_src>;
> +    };
> +
> +    audio-codec {
> +        // ...
> +
> +        port {
> +            codec_endpoint_src: endpoint {
> +                remote-endpoint = <&cpu_endpoint_src>;
> +            };
> +        };
> +    };
> +
> +    dai-controller {
> +        // ...
> +
> +        cpu_port_src: port {
> +            cpu_endpoint_src: endpoint {
> +                remote-endpoint = <&codec_endpoint_src>;
> +
> +                dai-format = "left_j";
> +
> +                // ...
> +            };
> +        };
> +    };
> +
> +  # ----------------------
> +  # 2 CPU 1 Codec (Mixing)
> +  # ----------------------
> +  - |
> +    sound_card {
> +        compatible = "audio-graph-card";
> +
> +        label = "sound-card";
> +        routing = "codec Playback", "DAI0 Playback",
> +                  "codec Playback", "DAI1 Playback",
> +                  "DAI0 Capture",   "codec Capture";
> +
> +        dais = <&cpu_port_mix>;
> +    };
> +
> +    audio-codec {
> +        // ...
> +
> +        audio-graph-card,prefix = "codec";
> +        audio-graph-card,convert-rate = <48000>;
> +
> +        port {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            codec_endpoint0_mix: endpoint@0 {
> +                reg = <0>;
> +
> +                remote-endpoint = <&cpu_endpoint0_mix>;
> +            };
> +            codec_endpoint1_mix: endpoint@1 {
> +                reg = <1>;
> +
> +                remote-endpoint = <&cpu_endpoint1_mix>;
> +            };
> +        };
> +    };
> +
> +    dai-controller {
> +        // ...
> +
> +        cpu_port_mix: port {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            cpu_endpoint0_mix: endpoint@0 {
> +                reg = <0>;
> +
> +                remote-endpoint = <&codec_endpoint0_mix>;
> +
> +                dai-format = "left_j";
> +
> +                // ...
> +            };
> +            cpu_endpoint1_mix: endpoint@1 {
> +                reg = <1>;
> +
> +                remote-endpoint = <&codec_endpoint1_mix>;
> +
> +                dai-format = "left_j";
> +
> +                // ...
> +            };
> +        };
> +    };
> +
> +  # -------------------
> +  # Multi DAI with DPCM
> +  #
> +  #  CPU0 ------ ak4613
> +  #  CPU1 ------ HDMI
> +  #  CPU2 ------ PCM3168A-p    /* DPCM 1ch/2ch */
> +  #  CPU3 --/                  /* DPCM 3ch/4ch */
> +  #  CPU4 --/                  /* DPCM 5ch/6ch */
> +  #  CPU5 --/                  /* DPCM 7ch/8ch */
> +  #  CPU6 ------ PCM3168A-c
> +  # -------------------
> +  - |
> +    sound_card: sound {
> +        compatible = "audio-graph-card";
> +
> +        label = "sound-card";
> +
> +        routing = "pcm3168a Playback", "DAI2 Playback",
> +                  "pcm3168a Playback", "DAI3 Playback",
> +                  "pcm3168a Playback", "DAI4 Playback",
> +                  "pcm3168a Playback", "DAI5 Playback";
> +
> +        dais = <&snd_port0    /* ak4613 */
> +                &snd_port1    /* HDMI0  */
> +                &snd_port2    /* pcm3168a playback */
> +                &snd_port3    /* pcm3168a capture  */
> +                >;
> +    };
> +
> +    ak4613: codec-10 {
> +        // ...
> +
> +        port {
> +            ak4613_endpoint: endpoint {
> +                remote-endpoint = <&rsnd_endpoint0>;
> +            };
> +        };
> +    };
> +
> +    pcm3168a: audio-codec-44 {
> +        // ...
> +
> +        audio-graph-card,prefix = "pcm3168a";
> +        audio-graph-card,convert-channels = <8>; /* TDM Split */
> +
> +        ports {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            port@0 {
> +                #address-cells = <1>;
> +                #size-cells = <0>;
> +
> +                reg = <0>;
> +                pcm3168a_endpoint_p1: endpoint@1 {
> +                    reg = <1>;
> +                    remote-endpoint = <&rsnd_endpoint2>;
> +
> +                    // ...
> +                };
> +                pcm3168a_endpoint_p2: endpoint@2 {
> +                    reg = <2>;
> +                    remote-endpoint = <&rsnd_endpoint3>;
> +
> +                    // ...
> +                };
> +                pcm3168a_endpoint_p3: endpoint@3 {
> +                    reg = <3>;
> +                    remote-endpoint = <&rsnd_endpoint4>;
> +
> +                    // ...
> +                };
> +                pcm3168a_endpoint_p4: endpoint@4 {
> +                    reg = <4>;
> +                    remote-endpoint = <&rsnd_endpoint5>;
> +
> +                    // ...
> +                };
> +            };
> +            port@1 {
> +                reg = <1>;
> +                pcm3168a_endpoint_c: endpoint {
> +                    remote-endpoint = <&rsnd_endpoint6>;
> +
> +                    // ...
> +                };
> +            };
> +        };
> +    };
> +
> +    dai-controller {
> +        ports {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            snd_port0: port@0 {
> +                reg = <0>;
> +                rsnd_endpoint0: endpoint {
> +                    remote-endpoint = <&ak4613_endpoint>;
> +
> +                    // ...
> +                };
> +            };
> +            snd_port1: port@1 {
> +                reg = <1>;
> +                rsnd_endpoint1: endpoint {
> +                    remote-endpoint = <&dw_hdmi0_snd_in>;
> +
> +                    // ...
> +                };
> +            };
> +            snd_port2: port@2 {
> +                #address-cells = <1>;
> +                #size-cells = <0>;
> +
> +                reg = <2>;
> +                rsnd_endpoint2: endpoint@2 {
> +                    reg = <2>;
> +                    remote-endpoint = <&pcm3168a_endpoint_p1>;
> +
> +                    // ...
> +                };
> +                rsnd_endpoint3: endpoint@3 {
> +                    reg = <3>;
> +                    remote-endpoint = <&pcm3168a_endpoint_p2>;
> +
> +                    // ...
> +                };
> +                rsnd_endpoint4: endpoint@4 {
> +                    reg = <4>;
> +                    remote-endpoint = <&pcm3168a_endpoint_p3>;
> +
> +                    // ...
> +                };
> +                rsnd_endpoint5: endpoint@5 {
> +                    reg = <5>;
> +                    remote-endpoint = <&pcm3168a_endpoint_p4>;
> +
> +                    // ...
> +                };
> +            };
> +            snd_port3: port@6 {
> +                reg = <6>;
> +                rsnd_endpoint6: endpoint {
> +                    remote-endpoint = <&pcm3168a_endpoint_c>;
> +
> +                    // ...
> +                };
> +            };
> +        };
> +    };
> +
> +...
> -- 
> 2.7.4
>
Kuninori Morimoto Oct. 19, 2020, 4:41 a.m. UTC | #2
Hi Sameer

> >> Convert device tree bindings of audio graph card to YAML format. Also
> >> expose some common definitions which can be used by similar graph based
> >> audio sound cards.
> >> 
> >> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> >> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> >> ---
> > I'm posting this patch to Rob & DT ML.
> > Not yet accepted, though..
> 
> Thanks for letting me know. I guess below is your patch,
> http://patchwork.ozlabs.org/project/devicetree-bindings/patch/877dtlvsxk.wl-kuninori.morimoto.gx@renesas.com/
> Do you have plans to resend this or send next revision?
> 
> I can drop my patch once yours is merged and refer the same for Tegra
> audio graph card.

I'm waiting response from Rob now.
It is merge window now. I will re-post it without his response
if -rc1 was released.

Thank you for your help !!

Best regards
---
Kuninori Morimoto
Rob Herring (Arm) Oct. 19, 2020, 10:11 p.m. UTC | #3
On Mon, Oct 19, 2020 at 01:41:40PM +0900, Kuninori Morimoto wrote:
> 
> Hi Sameer
> 
> > >> Convert device tree bindings of audio graph card to YAML format. Also
> > >> expose some common definitions which can be used by similar graph based
> > >> audio sound cards.
> > >> 
> > >> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> > >> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > >> ---
> > > I'm posting this patch to Rob & DT ML.
> > > Not yet accepted, though..
> > 
> > Thanks for letting me know. I guess below is your patch,
> > http://patchwork.ozlabs.org/project/devicetree-bindings/patch/877dtlvsxk.wl-kuninori.morimoto.gx@renesas.com/
> > Do you have plans to resend this or send next revision?
> > 
> > I can drop my patch once yours is merged and refer the same for Tegra
> > audio graph card.
> 
> I'm waiting response from Rob now.
> It is merge window now. I will re-post it without his response
> if -rc1 was released.

Sorry, fell off my radar. Now replied.

Rob