Skip to contentSkip to conversation

add ASoC components for AHUB

PATCH In review Sameer Pujar 7 participants 39 messages Feb 20, 2020 – Feb 28, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover add ASoC components for AHUB

Overview
========
The Audio Hub (AHUB) is part of the Audio Processing Engine (APE) which comprises a collection of hardware accelerators for audio pre-processing and post-processing. It also includes a programmable full crossbar for routing audio data across these accelerators.

This series exposes some of these below mentioned HW devices as ASoC components for Tegra platforms from Tegra210 onwards.
* ADMAIF : The interface between ADMA and AHUB

 * XBAR   : Crossbar for routing audio samples across various modules
 * I2S    : Inter-IC Sound Controller
 * DMIC   : Digital Microphone
 * DSPK   : Digital Speaker

Following is the summary of current series.
1. Add YAML DT binding documentation for above mentioned modules.
2. Helper function for ACIF programming is exposed for Tegra210 and later.
3. Add ASoC driver components for each of the above modules.
4. Add DT entries for above components for Tegra210, Tegra186 and

    Tegra194.

5. Enable these components for Jetson-Tx1, Jetson-Tx2 and Jetson-Xavier.

Machine driver series will be sent separately.

Changelog
=========

v2 -> v3
--------
* [1/10] "dt-bindings: sound: tegra: add DT binding for AHUB
- Updated licence
- Removed redundancy w.r.t items/const/enum
- Added constraints wherever needed with "pattern" property

* [2/10] "ASoC: tegra: add support for CIF programming"
- Removed tegra_cif.c
- Instead added inline helper function in tegra_cif.h

* common changes (for patch [3/10] to [7/10])
- Replace LATE system calls with Normal sleep
- Remove explicit RPM suspend in driver remove() call
- Use devm_kzalloc() instead of devm_kcalloc() for single element
- Replace 'ret' with 'err' for better reading
- Consistent error printing style across drivers
- Minor formating fixes

* [8/10] "arm64: tegra: add AHUB components for few Tegra chips"
- no change

* [9/10] "arm64: tegra: enable AHUB modules for few Tegra chips"
- no change

* [10/10] "arm64: defconfig: enable AHUB components for Tegra210 and later" (New patch)
- Enables ACONNECT and AHUB components. With this AHUB and components are registered with ASoC core.

v1 -> v2
--------
* [1/9] "dt-bindings: sound: tegra: add DT binding for AHUB"
- no changes

* [2/9] "ASoC: tegra: add support for CIF programming"
- removed CIF programming changes for legacy chips.
- this patch now exposes helper function for CIF programming, which can be used on Tegra210 later.
- later tegra_cif.c can be extended for legacy chips as well.
- updated commit message accordingly

* [3/9] "ASoC: tegra: add Tegra210 based DMIC driver"
- removed unnecessary initialization of 'ret' in probe()

* [4/9] "ASoC: tegra: add Tegra210 based I2S driver"
- removed unnecessary initialization of 'ret' in probe()
- fixed indentation
- added consistent bracing for if-else clauses
- updated 'rx_fifo_th' type to 'unsigned int'
- used BIT() macro for defines like '1 << {x}' in tegra210_i2s.h

* [5/9] "ASoC: tegra: add Tegra210 based AHUB driver"
- used of_device_get_match_data() to get 'soc_data' and removed explicit of_match_device()
- used devm_platform_ioremap_resource() and removed explicit platform_get_resource()
- fixed indentation for devm_snd_soc_register_component()
- updated commit message
- updated commit message to reflect compatible binding for Tegra186 and

     Tegra194.

* [6/9] "ASoC: tegra: add Tegra186 based DSPK driver"
- removed unnecessary initialization of 'ret' in probe()
- updated 'max_th' to 'unsigned int'
- shortened lengthy macro names to avoid wrapping in tegra186_dspk_wr_reg() and to be consistent

* [7/9] "ASoC: tegra: add Tegra210 based ADMAIF driver"
- used of_device_get_match_data() and removed explicit of_match_device()
- used BIT() macro for defines like '1 << {x}' in tegra210_admaif.h
- updated commit message to reflect compatible binding for Tegra186 and

     Tegra194.

* [8/9] "arm64: tegra: add AHUB components for few Tegra chips"
- no change

* [9/9] "arm64: tegra: enable AHUB modules for few Tegra chips"
- no change

* common changes for patch [3/9] to [7/9]
- sorted headers in alphabetical order
- moved MODULE_DEVICE_TABLE() right below *_of_match table
- removed macro DRV_NAME
- removed explicit 'owner' field from platform_driver structure
- added 'const' to snd_soc_dai_ops structure

=================
Sameer Pujar (10):
dt-bindings: sound: tegra: add DT binding for AHUB
ASoC: tegra: add support for CIF programming
ASoC: tegra: add Tegra210 based DMIC driver
ASoC: tegra: add Tegra210 based I2S driver
ASoC: tegra: add Tegra210 based AHUB driver
ASoC: tegra: add Tegra186 based DSPK driver
ASoC: tegra: add Tegra210 based ADMAIF driver
arm64: tegra: add AHUB components for few Tegra chips
arm64: tegra: enable AHUB modules for few Tegra chips
arm64: defconfig: enable AHUB components for Tegra210 and later

 .../bindings/sound/nvidia,tegra186-dspk.yaml       |  88 ++
 .../bindings/sound/nvidia,tegra210-admaif.yaml     | 163 ++++
 .../bindings/sound/nvidia,tegra210-ahub.yaml       | 110 +++
 .../bindings/sound/nvidia,tegra210-dmic.yaml       |  88 ++
 .../bindings/sound/nvidia,tegra210-i2s.yaml        | 101 +++
 arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts |  48 ++
 arch/arm64/boot/dts/nvidia/tegra186.dtsi           | 231 ++++-
 arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts |  36 +
 arch/arm64/boot/dts/nvidia/tegra194.dtsi           | 239 +++++-
 arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts |  40 +
 arch/arm64/boot/dts/nvidia/tegra210.dtsi           | 145 ++++
 arch/arm64/configs/defconfig                       |   7 +
 sound/soc/tegra/Kconfig                            |  56 ++
 sound/soc/tegra/Makefile                           |  10 +
 sound/soc/tegra/tegra186_dspk.c                    | 510 +++++++++++
 sound/soc/tegra/tegra186_dspk.h                    |  73 ++
 sound/soc/tegra/tegra210_admaif.c                  | 884 +++++++++++++++++++
 sound/soc/tegra/tegra210_admaif.h                  | 164 ++++
 sound/soc/tegra/tegra210_ahub.c                    | 651 ++++++++++++++
 sound/soc/tegra/tegra210_ahub.h                    | 125 +++
 sound/soc/tegra/tegra210_dmic.c                    | 515 +++++++++++
 sound/soc/tegra/tegra210_dmic.h                    |  85 ++
 sound/soc/tegra/tegra210_i2s.c                     | 938 +++++++++++++++++++++
 sound/soc/tegra/tegra210_i2s.h                     | 132 +++
 sound/soc/tegra/tegra_cif.h                        |  63 ++
 sound/soc/tegra/tegra_pcm.c                        | 222 ++++-
 sound/soc/tegra/tegra_pcm.h                        |  23 +-
 27 files changed, 5743 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-dmic.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-i2s.yaml
 create mode 100644 sound/soc/tegra/tegra186_dspk.c
 create mode 100644 sound/soc/tegra/tegra186_dspk.h
 create mode 100644 sound/soc/tegra/tegra210_admaif.c
 create mode 100644 sound/soc/tegra/tegra210_admaif.h
 create mode 100644 sound/soc/tegra/tegra210_ahub.c
 create mode 100644 sound/soc/tegra/tegra210_ahub.h
 create mode 100644 sound/soc/tegra/tegra210_dmic.c
 create mode 100644 sound/soc/tegra/tegra210_dmic.h
 create mode 100644 sound/soc/tegra/tegra210_i2s.c
 create mode 100644 sound/soc/tegra/tegra210_i2s.h
 create mode 100644 sound/soc/tegra/tegra_cif.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH v3 1/10 dt-bindings: sound: tegra: add DT binding for AHUB

Audio Hub (AHUB) comprises a collection of hardware accelerators for audio pre-processing and post-processing and a programmable full crossbar for audio routing across these accelerators. This patch adds YAML schema for DT binding of AHUB and few of its following components. These devices will be registered as ASoC components.
* ADMAIF
* I2S
* DMIC
* DSPK

---
 .../bindings/sound/nvidia,tegra186-dspk.yaml       |  88 +++++++++++
 .../bindings/sound/nvidia,tegra210-admaif.yaml     | 163 +++++++++++++++++++++
 .../bindings/sound/nvidia,tegra210-ahub.yaml       | 110 ++++++++++++++
 .../bindings/sound/nvidia,tegra210-dmic.yaml       |  88 +++++++++++
 .../bindings/sound/nvidia,tegra210-i2s.yaml        | 101 +++++++++++++
 5 files changed, 550 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-dmic.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-i2s.yaml
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +88 -0
new file mode 100644
index 0000000..79c720d
@@ -0,0 +1,88 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/nvidia,tegra186-dspk.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Tegra186 DSPK Controller Device Tree Bindings
+
+description: |
+  The Digital Speaker Controller (DSPK) can be viewed as a Pulse
+  Density Modulation (PDM) transmitter that up-samples the input to
+  the desired sampling rate by interpolation and then converts the
+  over sampled Pulse Code Modulation (PCM) input to the desired 1-bit
+  output via Delta Sigma Modulation (DSM).
+
+maintainers:
+  - Jon Hunter <[email protected]>
+  - Sameer Pujar <[email protected]>
+
+properties:
+  $nodename:
+    pattern: "^dspk@[0-9a-f]*$"
+
+  compatible:
+    oneOf:
+      - const: nvidia,tegra186-dspk
+      - items:
+          - const: nvidia,tegra194-dspk
+          - const: nvidia,tegra186-dspk
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    description: DSPK interface clock
+
+  clock-names:
+    const: dspk
+
+  assigned-clocks:
+    description: DSPK interface clock
+
+  assigned-clock-parents:
+    description: Parent for DSPK interface clock
+
+  assigned-clock-rates:
+    description: Initial rate of DSPK interface clock
+
+  "#sound-dai-cells":
+    const: 1
+
+  sound-name-prefix:
+    pattern: "^DSPK[1-9]$"
+    allOf:
+      - $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 "DSPK1" or "DSPKx", where x depends on the maximum
+      available instances on a Tegra SoC.
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - assigned-clocks
+  - assigned-clock-parents
+  - "#sound-dai-cells"
+  - sound-name-prefix
+
+examples:
+  - |
+    #include<dt-bindings/clock/tegra186-clock.h>
+
+    dspk@2905000 {
+        compatible = "nvidia,tegra186-dspk";
+        reg = <0x2905000 0x100>;
+        clocks = <&bpmp TEGRA186_CLK_DSPK1>;
+        clock-names = "dspk";
+        assigned-clocks = <&bpmp TEGRA186_CLK_DSPK1>;
+        assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+        assigned-clock-rates = <12288000>;
+        #sound-dai-cells = <1>;
+        sound-name-prefix = "DSPK1";
+    };
+
+...
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml new file +163 -0

163 lines not on this page · raw message

Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml new file +110 -0

110 lines not on this page · raw message

Documentation/devicetree/bindings/sound/nvidia,tegra210-dmic.yaml new file +88 -0

88 lines not on this page · raw message

Documentation/devicetree/bindings/sound/nvidia,tegra210-i2s.yaml new file +101 -0

101 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer
#2 lore raw

Re: [PATCH v3 01/10] dt-bindings: sound: tegra: add DT binding for AHUB

Quoted 3 lines · Sameer Pujar

Audio Hub (AHUB) comprises a collection of hardware accelerators for audio pre-processing and post-processing and a programmable full crossbar for audio routing across these accelerators. This patch adds YAML schema for DT

Please submit patches using subject lines reflecting the style for the subsystem, this makes it easier for people to identify relevant patches. Look at what existing commits in the area you're changing are doing and make sure your subject lines visually resemble what they're doing. There's no need to resubmit to fix this alone.

maintainer
#3 lore raw

Re: [PATCH v3 01/10] dt-bindings: sound: tegra: add DT binding for AHUB

In reply to Sameer Pujar
Quoted 55 lines · Sameer Pujar

Audio Hub (AHUB) comprises a collection of hardware accelerators for audio pre-processing and post-processing and a programmable full crossbar for audio routing across these accelerators. This patch adds YAML schema for DT binding of AHUB and few of its following components. These devices will be registered as ASoC components.
* ADMAIF
* I2S
* DMIC
* DSPK

---
 .../bindings/sound/nvidia,tegra186-dspk.yaml       |  88 +++++++++++
 .../bindings/sound/nvidia,tegra210-admaif.yaml     | 163 +++++++++++++++++++++
 .../bindings/sound/nvidia,tegra210-ahub.yaml       | 110 ++++++++++++++
 .../bindings/sound/nvidia,tegra210-dmic.yaml       |  88 +++++++++++
 .../bindings/sound/nvidia,tegra210-i2s.yaml        | 101 +++++++++++++
 5 files changed, 550 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-dmic.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-i2s.yaml
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +25 -0
new file mode 100644
index 0000000..79c720d
@@ -0,0 +1,88 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/nvidia,tegra186-dspk.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Tegra186 DSPK Controller Device Tree Bindings
+
+description: |
+  The Digital Speaker Controller (DSPK) can be viewed as a Pulse
+  Density Modulation (PDM) transmitter that up-samples the input to
+  the desired sampling rate by interpolation and then converts the
+  over sampled Pulse Code Modulation (PCM) input to the desired 1-bit
+  output via Delta Sigma Modulation (DSM).
+
+maintainers:
+  - Jon Hunter <[email protected]>
+  - Sameer Pujar <[email protected]>
+
+properties:
+  $nodename:
+    pattern: "^dspk@[0-9a-f]*$"
+
+  compatible:
+    oneOf:

Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 35

Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +10 -0
+      - const: nvidia,tegra186-dspk
+      - items:
+          - const: nvidia,tegra194-dspk
+          - const: nvidia,tegra186-dspk
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    description: DSPK interface clock

Needs:

maxItems: 1

I'd drop the description too. It's pretty generic...

Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 47

Quoted 13 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +12 -0
+
+  clock-names:
+    const: dspk
+
 
+  assigned-clocks:
+    description: DSPK interface clock
+
+  assigned-clock-parents:
+    description: Parent for DSPK interface clock
+
+  assigned-clock-rates:
+    description: Initial rate of DSPK interface clock

maxItems: 1 for these 3.

Quoted 198 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +41 -0
+
+  "#sound-dai-cells":
+    const: 1
+
+  sound-name-prefix:
+    pattern: "^DSPK[1-9]$"
+    allOf:
+      - $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 "DSPK1" or "DSPKx", where x depends on the maximum
+      available instances on a Tegra SoC.
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - assigned-clocks
+  - assigned-clock-parents
+  - "#sound-dai-cells"
+  - sound-name-prefix
+
+examples:
+  - |
+    #include<dt-bindings/clock/tegra186-clock.h>
+
+    dspk@2905000 {
+        compatible = "nvidia,tegra186-dspk";
+        reg = <0x2905000 0x100>;
+        clocks = <&bpmp TEGRA186_CLK_DSPK1>;
+        clock-names = "dspk";
+        assigned-clocks = <&bpmp TEGRA186_CLK_DSPK1>;
+        assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+        assigned-clock-rates = <12288000>;
+        #sound-dai-cells = <1>;
+        sound-name-prefix = "DSPK1";
+    };
+
+...
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml new file +151 -0
new file mode 100644
index 0000000..46637c6a
@@ -0,0 +1,163 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/nvidia,tegra210-admaif.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Tegra210 ADMAIF Device Tree Bindings
+
+description: |
+  ADMAIF is the interface between ADMA and AHUB. Each ADMA channel
+  that sends/receives data to/from AHUB must interface through an
+  ADMAIF channel. ADMA channel sending data to AHUB pairs with ADMAIF
+  Tx channel and ADMA channel receiving data from AHUB pairs with
+  ADMAIF Rx channel.
+
+maintainers:
+  - Jon Hunter <[email protected]>
+  - Sameer Pujar <[email protected]>
+
+properties:
+  $nodename:
+    pattern: "^admaif@[0-9a-f]*$"
+
+  compatible:
+    oneOf:
+      - enum:
+          - nvidia,tegra210-admaif
+          - nvidia,tegra186-admaif
+      - items:
+          - const: nvidia,tegra194-admaif
+          - const: nvidia,tegra186-admaif
+
+  reg:
+    maxItems: 1
+
+  dmas: true
+
+  dma-names: true
+
+  "#sound-dai-cells":
+    const: 1
+
+if:
+  properties:
+    compatible:
+      contains:
+        const: nvidia,tegra210-admaif
+
+then:
+  properties:
+    dmas:
+      description:
+        DMA channel specifiers, equally divided for Tx and Rx.
+      minItems: 1
+      maxItems: 20
+    dma-names:
+      items:
+        pattern: "^[rt]x(10|[1-9])$"
+      description:
+        Should be "rx1", "rx2" ... "rx10" for DMA Rx channel
+        Should be "tx1", "tx2" ... "tx10" for DMA Tx channel
+      minItems: 1
+      maxItems: 20
+
+else:
+  properties:
+    dmas:
+      description:
+        DMA channel specifiers, equally divided for Tx and Rx.
+      minItems: 1
+      maxItems: 40
+    dma-names:
+      items:
+        pattern: "^[rt]x(1[0-9]|[1-9]|20)$"
+      description:
+        Should be "rx1", "rx2" ... "rx20" for DMA Rx channel
+        Should be "tx1", "tx2" ... "tx20" for DMA Tx channel
+      minItems: 1
+      maxItems: 40
+
+required:
+  - compatible
+  - reg
+  - dmas
+  - dma-names
+  - "#sound-dai-cells"
+
+examples:
+  - |
+    admaif@702d0000 {
+        compatible = "nvidia,tegra210-admaif";
+        reg = <0x702d0000 0x800>;
+        dmas = <&adma 1>,  <&adma 1>,
+               <&adma 2>,  <&adma 2>,
+               <&adma 3>,  <&adma 3>,
+               <&adma 4>,  <&adma 4>,
+               <&adma 5>,  <&adma 5>,
+               <&adma 6>,  <&adma 6>,
+               <&adma 7>,  <&adma 7>,
+               <&adma 8>,  <&adma 8>,
+               <&adma 9>,  <&adma 9>,
+               <&adma 10>, <&adma 10>;
+        dma-names = "rx1",  "tx1",
+                    "rx2",  "tx2",
+                    "rx3",  "tx3",
+                    "rx4",  "tx4",
+                    "rx5",  "tx5",
+                    "rx6",  "tx6",
+                    "rx7",  "tx7",
+                    "rx8",  "tx8",
+                    "rx9",  "tx9",
+                    "rx10", "tx10";
+        #sound-dai-cells = <1>;
+    };
+
+  - |
+    admaif@290f000 {
+        compatible = "nvidia,tegra186-admaif";
+        reg = <0x0290f000 0x1000>;
+        dmas = <&adma 1>, <&adma 1>,
+               <&adma 2>, <&adma 2>,
+               <&adma 3>, <&adma 3>,
+               <&adma 4>, <&adma 4>,
+               <&adma 5>, <&adma 5>,
+               <&adma 6>, <&adma 6>,
+               <&adma 7>, <&adma 7>,
+               <&adma 8>, <&adma 8>,
+               <&adma 9>, <&adma 9>,
+               <&adma 10>, <&adma 10>,
+               <&adma 11>, <&adma 11>,
+               <&adma 12>, <&adma 12>,
+               <&adma 13>, <&adma 13>,
+               <&adma 14>, <&adma 14>,
+               <&adma 15>, <&adma 15>,
+               <&adma 16>, <&adma 16>,
+               <&adma 17>, <&adma 17>,
+               <&adma 18>, <&adma 18>,
+               <&adma 19>, <&adma 19>,
+               <&adma 20>, <&adma 20>;
+        dma-names = "rx1", "tx1",
+                    "rx2", "tx2",
+                    "rx3", "tx3",
+                    "rx4", "tx4",
+                    "rx5", "tx5",
+                    "rx6", "tx6",
+                    "rx7", "tx7",
+                    "rx8", "tx8",
+                    "rx9", "tx9",
+                    "rx10", "tx10",
+                    "rx11", "tx11",
+                    "rx12", "tx12",

Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml line 161

Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml new file +10 -0
+                    "rx13", "tx13",
+                    "rx14", "tx14",
+                    "rx15", "tx15",
+                    "rx16", "tx16",
+                    "rx17", "tx17",
+                    "rx18", "tx18",
+                    "rx19", "tx19",
+                    "rx20", "tx20";
+        #sound-dai-cells = <1>;
+    };

I don't see a lot of value in having 2 examples.

Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml

Quoted 7 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml new file +2 -0
+
+...
Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml new file +0 -0
new file mode 100644
index 0000000..5f3e1ed

Same prior comments apply here.

Quoted 49 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml new file +48 -0
@@ -0,0 +1,110 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/nvidia,tegra210-ahub.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Tegra210 AHUB Device Tree Bindings
+
+description: |
+  The Audio Hub (AHUB) comprises a collection of hardware accelerators
+  for audio pre-processing, post-processing and a programmable full
+  crossbar for routing audio data across these accelerators. It has
+  external interfaces such as I2S, DMIC, DSPK. It interfaces with ADMA
+  engine through ADMAIF.
+
+maintainers:
+  - Jon Hunter <[email protected]>
+  - Sameer Pujar <[email protected]>
+
+properties:
+  $nodename:
+    pattern: "^ahub@[0-9a-f]*$"
+
+  compatible:
+    oneOf:
+      - enum:
+          - nvidia,tegra210-ahub
+          - nvidia,tegra186-ahub
+      - items:
+          - const: nvidia,tegra194-ahub
+          - const: nvidia,tegra186-ahub
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    description: AHUB module clock
+
+  clock-names:
+    const: ahub
+
+  assigned-clocks:
+    description: AHUB module clock
+
+  assigned-clock-parents:
+    description: parent for AHUB module clock
+
+  assigned-clock-rates:

Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml line 58

Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml new file +10 -0
+    description: AHUB module clock rate
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+  ranges:
+    $ref: /schemas/types.yaml#/definitions/uint32-array

ranges already has a type.

Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml line 59

Quoted 1 line
Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml new file +1 -0
+    description: Specify address range for the node and its children

Drop. That's every 'ranges'.

Quoted 22 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml new file +22 -0
+    minItems: 1
+
+  "#sound-dai-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - assigned-clocks
+  - assigned-clock-parents
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
+  - "#sound-dai-cells"
+
+examples:
+  - |
+    #include<dt-bindings/clock/tegra210-car.h>
+
+    ahub@702d0800 {

Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml line 90

Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml new file +9 -0
+        compatible = "nvidia,tegra210-ahub";
+        reg = <0x702d0800 0x800>;
+        clocks = <&tegra_car TEGRA210_CLK_D_AUDIO>;
+        clock-names = "ahub";
+        assigned-clocks = <&tegra_car TEGRA210_CLK_D_AUDIO>;
+        assigned-clock-parents = <&tegra_car TEGRA210_CLK_PLL_A_OUT0>;
 
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x702d0000 0x702d0000 0x0000e400>;

These properties imply you have child nodes, but none are defined.

Quoted 8 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml new file +8 -0
+        #sound-dai-cells = <1>;
+    };
+
+  - |
+    #include<dt-bindings/clock/tegra186-clock.h>
+
+    ahub@2900800 {
+        compatible = "nvidia,tegra186-ahub";

Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml line 108

Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml new file +10 -0
+        reg = <0x02900800 0x800>;
+        clocks = <&bpmp TEGRA186_CLK_AHUB>;
+        clock-names = "ahub";
+        assigned-clocks = <&bpmp TEGRA186_CLK_AHUB>;
+        assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x02900800 0x02900800 0x11800>;
+        #sound-dai-cells = <1>;
+    };

Really need 2 examples?

Quoted 2 lines

+
+...

Same comments apply to the rest.

#4 lore raw

PATCH v3 2/10 ASoC: tegra: add support for CIF programming

In reply to Sameer Pujar

Audio Client Interface (CIF) is a proprietary interface employed to route audio samples through Audio Hub (AHUB) components by inter connecting the various modules.

This patch exports an inline function tegra_set_cif() which can be used, for now, to program CIF on Tegra210 and later Tegra generations. Later it can be extended to include helpers for legacy chips as well.

---
 sound/soc/tegra/tegra_cif.h | 63 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 sound/soc/tegra/tegra_cif.h
sound/soc/tegra/tegra_cif.h new file +63 -0
new file mode 100644
index 0000000..ecc0850
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * tegra_cif.h - TEGRA Audio CIF Programming
+ *
+ * Copyright (c) 2020 NVIDIA CORPORATION.  All rights reserved.
+ *
+ */
+
+#ifndef __TEGRA_CIF_H__
+#define __TEGRA_CIF_H__
+
+#define TEGRA_ACIF_CTRL_FIFO_TH_SHIFT		24
+#define TEGRA_ACIF_CTRL_AUDIO_CH_SHIFT		20
+#define TEGRA_ACIF_CTRL_CLIENT_CH_SHIFT		16
+#define TEGRA_ACIF_CTRL_AUDIO_BITS_SHIFT	12
+#define TEGRA_ACIF_CTRL_CLIENT_BITS_SHIFT	8
+#define TEGRA_ACIF_CTRL_EXPAND_SHIFT		6
+#define TEGRA_ACIF_CTRL_STEREO_CONV_SHIFT	4
+#define TEGRA_ACIF_CTRL_REPLICATE_SHIFT		3
+#define TEGRA_ACIF_CTRL_TRUNCATE_SHIFT		1
+#define TEGRA_ACIF_CTRL_MONO_CONV_SHIFT		0
+
+/* AUDIO/CLIENT_BITS values */
+#define TEGRA_ACIF_BITS_8			1
+#define TEGRA_ACIF_BITS_16			3
+#define TEGRA_ACIF_BITS_24			5
+#define TEGRA_ACIF_BITS_32			7
+
+#define TEGRA_ACIF_UPDATE_MASK			0x3ffffffb
+
+struct tegra_cif_conf {
+	unsigned int threshold;
+	unsigned int audio_ch;
+	unsigned int client_ch;
+	unsigned int audio_bits;
+	unsigned int client_bits;
+	unsigned int expand;
+	unsigned int stereo_conv;
+	unsigned int replicate;
+	unsigned int truncate;
+	unsigned int mono_conv;
+};
+
+static inline void tegra_set_cif(struct regmap *regmap, unsigned int reg,
+				 struct tegra_cif_conf *conf)
+{
+	unsigned int value;
+
+	value = (conf->threshold << TEGRA_ACIF_CTRL_FIFO_TH_SHIFT) |
+		((conf->audio_ch - 1) << TEGRA_ACIF_CTRL_AUDIO_CH_SHIFT) |
+		((conf->client_ch - 1) << TEGRA_ACIF_CTRL_CLIENT_CH_SHIFT) |
+		(conf->audio_bits << TEGRA_ACIF_CTRL_AUDIO_BITS_SHIFT) |
+		(conf->client_bits << TEGRA_ACIF_CTRL_CLIENT_BITS_SHIFT) |
+		(conf->expand << TEGRA_ACIF_CTRL_EXPAND_SHIFT) |
+		(conf->stereo_conv << TEGRA_ACIF_CTRL_STEREO_CONV_SHIFT) |
+		(conf->replicate << TEGRA_ACIF_CTRL_REPLICATE_SHIFT) |
+		(conf->truncate << TEGRA_ACIF_CTRL_TRUNCATE_SHIFT) |
+		(conf->mono_conv << TEGRA_ACIF_CTRL_MONO_CONV_SHIFT);
+
+	regmap_update_bits(regmap, reg, TEGRA_ACIF_UPDATE_MASK, value);
+}
+
+#endif
Signature · 1 line
2.7.4
maintainer Reviewed-by on v3 2/10
#5 lore raw

Re: [PATCH v3 02/10] ASoC: tegra: add support for CIF programming

Quoted 73 lines · Sameer Pujar

Audio Client Interface (CIF) is a proprietary interface employed to route audio samples through Audio Hub (AHUB) components by inter connecting the various modules.

This patch exports an inline function tegra_set_cif() which can be used, for now, to program CIF on Tegra210 and later Tegra generations. Later it can be extended to include helpers for legacy chips as well.

---
 sound/soc/tegra/tegra_cif.h | 63 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 sound/soc/tegra/tegra_cif.h
sound/soc/tegra/tegra_cif.h new file +53 -0
new file mode 100644
index 0000000..ecc0850
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * tegra_cif.h - TEGRA Audio CIF Programming
+ *
+ * Copyright (c) 2020 NVIDIA CORPORATION.  All rights reserved.
+ *
+ */
+
+#ifndef __TEGRA_CIF_H__
+#define __TEGRA_CIF_H__
+
+#define TEGRA_ACIF_CTRL_FIFO_TH_SHIFT		24
+#define TEGRA_ACIF_CTRL_AUDIO_CH_SHIFT		20
+#define TEGRA_ACIF_CTRL_CLIENT_CH_SHIFT		16
+#define TEGRA_ACIF_CTRL_AUDIO_BITS_SHIFT	12
+#define TEGRA_ACIF_CTRL_CLIENT_BITS_SHIFT	8
+#define TEGRA_ACIF_CTRL_EXPAND_SHIFT		6
+#define TEGRA_ACIF_CTRL_STEREO_CONV_SHIFT	4
+#define TEGRA_ACIF_CTRL_REPLICATE_SHIFT		3
+#define TEGRA_ACIF_CTRL_TRUNCATE_SHIFT		1
+#define TEGRA_ACIF_CTRL_MONO_CONV_SHIFT		0
+
+/* AUDIO/CLIENT_BITS values */
+#define TEGRA_ACIF_BITS_8			1
+#define TEGRA_ACIF_BITS_16			3
+#define TEGRA_ACIF_BITS_24			5
+#define TEGRA_ACIF_BITS_32			7
+
+#define TEGRA_ACIF_UPDATE_MASK			0x3ffffffb
+
+struct tegra_cif_conf {
+	unsigned int threshold;
+	unsigned int audio_ch;
+	unsigned int client_ch;
+	unsigned int audio_bits;
+	unsigned int client_bits;
+	unsigned int expand;
+	unsigned int stereo_conv;
+	unsigned int replicate;
+	unsigned int truncate;
+	unsigned int mono_conv;
+};
+
+static inline void tegra_set_cif(struct regmap *regmap, unsigned int reg,
+				 struct tegra_cif_conf *conf)
+{
+	unsigned int value;
+
+	value = (conf->threshold << TEGRA_ACIF_CTRL_FIFO_TH_SHIFT) |
+		((conf->audio_ch - 1) << TEGRA_ACIF_CTRL_AUDIO_CH_SHIFT) |
+		((conf->client_ch - 1) << TEGRA_ACIF_CTRL_CLIENT_CH_SHIFT) |
+		(conf->audio_bits << TEGRA_ACIF_CTRL_AUDIO_BITS_SHIFT) |
+		(conf->client_bits << TEGRA_ACIF_CTRL_CLIENT_BITS_SHIFT) |

sound/soc/tegra/tegra_cif.h line 63

Quoted 10 lines
sound/soc/tegra/tegra_cif.h new file +10 -0
+		(conf->expand << TEGRA_ACIF_CTRL_EXPAND_SHIFT) |
+		(conf->stereo_conv << TEGRA_ACIF_CTRL_STEREO_CONV_SHIFT) |
+		(conf->replicate << TEGRA_ACIF_CTRL_REPLICATE_SHIFT) |
+		(conf->truncate << TEGRA_ACIF_CTRL_TRUNCATE_SHIFT) |
+		(conf->mono_conv << TEGRA_ACIF_CTRL_MONO_CONV_SHIFT);
+
+	regmap_update_bits(regmap, reg, TEGRA_ACIF_UPDATE_MASK, value);
+}
+
+#endif

Cheers!
Jon

Signature · 1 line
nvpublic
Reviewed-by on v3 2/10
#6 lore raw

Re: [PATCH v3 02/10] ASoC: tegra: add support for CIF programming

In reply to Sameer Pujar

20.02.2020 09:34, Sameer Pujar пишет:

Quoted 20 lines

Audio Client Interface (CIF) is a proprietary interface employed to route audio samples through Audio Hub (AHUB) components by inter connecting the various modules.

This patch exports an inline function tegra_set_cif() which can be used, for now, to program CIF on Tegra210 and later Tegra generations. Later it can be extended to include helpers for legacy chips as well.

---
 sound/soc/tegra/tegra_cif.h | 63 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 sound/soc/tegra/tegra_cif.h
sound/soc/tegra/tegra_cif.h new file +0 -0
new file mode 100644
index 0000000..ecc0850

sound/soc/tegra/tegra_cif.h line 10

Quoted 10 lines
sound/soc/tegra/tegra_cif.h new file +10 -0
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * tegra_cif.h - TEGRA Audio CIF Programming
+ *
+ * Copyright (c) 2020 NVIDIA CORPORATION.  All rights reserved.
+ *
+ */
+
+#ifndef __TEGRA_CIF_H__
+#define __TEGRA_CIF_H__

For completeness here should be:

#include <linux/regmap.h>

...

Quoted 3 lines
sound/soc/tegra/tegra_cif.h new file +3 -0
+static inline void tegra_set_cif(struct regmap *regmap, unsigned int reg,
+				 struct tegra_cif_conf *conf)
+{

...

sound/soc/tegra/tegra_cif.h line 63

Quoted 5 lines
sound/soc/tegra/tegra_cif.h new file +4 -0
+	regmap_update_bits(regmap, reg, TEGRA_ACIF_UPDATE_MASK, value);
+}
+
+#endif

Otherwise:

#7 lore raw

PATCH v3 3/10 ASoC: tegra: add Tegra210 based DMIC driver

In reply to Sameer Pujar

The Digital MIC (DMIC) Controller is used to interface with Pulse Density Modulation (PDM) input devices. The DMIC controller implements a converter to convert PDM signals to Pulse Code Modulation (PCM) signals. From signal flow perspective, the DMIC can be viewed as a PDM receiver.

This patch registers DMIC component with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes DMIC interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow to build the driver. The DMIC devices can be enabled in the DT via "nvidia,tegra210-dmic" compatible string. This driver can be used for Tegra186 and Tegra194 chips as well.

---
 sound/soc/tegra/Kconfig         |  11 +
 sound/soc/tegra/Makefile        |   2 +
 sound/soc/tegra/tegra210_dmic.c | 515 ++++++++++++++++++++++++++++++++++++++++
 sound/soc/tegra/tegra210_dmic.h |  85 +++++++
 4 files changed, 613 insertions(+)
 create mode 100644 sound/soc/tegra/tegra210_dmic.c
 create mode 100644 sound/soc/tegra/tegra210_dmic.h
sound/soc/tegra/Kconfig +11 -0
index addadc8..2bde1e6 100644
@@ -62,6 +62,17 @@ config SND_SOC_TEGRA30_I2S
 	  Tegra30 I2S interface. You will also need to select the individual
 	  machine drivers to support below.
 
+config SND_SOC_TEGRA210_DMIC
+        tristate "Tegra210 DMIC module"
+        depends on SND_SOC_TEGRA
+        help
+          Config to enable the Digital MIC (DMIC) controller which is used
+          to interface with Pulse Density Modulation (PDM) input devices.
+          The DMIC controller implements a converter to convert PDM signals
+          to Pulse Code Modulation (PCM) signals. This can be viewed as a
+          PDM receiver.
+          Say Y or M if you want to add support for Tegra210 DMIC module.
+
 config SND_SOC_TEGRA_RT5640
 	tristate "SoC Audio support for Tegra boards using an RT5640 codec"
 	depends on SND_SOC_TEGRA && I2C && GPIOLIB
sound/soc/tegra/Makefile +2 -0
index c84f183..f0690cf 100644
@@ -8,6 +8,7 @@ snd-soc-tegra20-i2s-objs := tegra20_i2s.o
 snd-soc-tegra20-spdif-objs := tegra20_spdif.o
 snd-soc-tegra30-ahub-objs := tegra30_ahub.o
 snd-soc-tegra30-i2s-objs := tegra30_i2s.o
+snd-soc-tegra210-dmic-objs := tegra210_dmic.o
 
 obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-pcm.o
 obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-utils.o
@@ -17,6 +18,7 @@ obj-$(CONFIG_SND_SOC_TEGRA20_I2S) += snd-soc-tegra20-i2s.o
 obj-$(CONFIG_SND_SOC_TEGRA20_SPDIF) += snd-soc-tegra20-spdif.o
 obj-$(CONFIG_SND_SOC_TEGRA30_AHUB) += snd-soc-tegra30-ahub.o
 obj-$(CONFIG_SND_SOC_TEGRA30_I2S) += snd-soc-tegra30-i2s.o
+obj-$(CONFIG_SND_SOC_TEGRA210_DMIC) += snd-soc-tegra210-dmic.o
 
 # Tegra machine Support
 snd-soc-tegra-rt5640-objs := tegra_rt5640.o
sound/soc/tegra/tegra210_dmic.c new file +515 -0

515 lines not on this page · raw message

sound/soc/tegra/tegra210_dmic.h new file +85 -0

85 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer Reviewed-by on v3 3/10
#8 lore raw

Re: [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver

Quoted 13 lines · Sameer Pujar

The Digital MIC (DMIC) Controller is used to interface with Pulse Density Modulation (PDM) input devices. The DMIC controller implements a converter to convert PDM signals to Pulse Code Modulation (PCM) signals. From signal flow perspective, the DMIC can be viewed as a PDM receiver.

This patch registers DMIC component with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes DMIC interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow to build the driver. The DMIC devices can be enabled in the DT via "nvidia,tegra210-dmic" compatible string. This driver can be used for Tegra186 and Tegra194 chips as well.

Quoted 1 line

Thanks!

Cheers
Jon

Signature · 1 line
nvpublic
Reviewed-by on v3 3/10
#9 lore raw

Re: [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver

In reply to Sameer Pujar

20.02.2020 09:34, Sameer Pujar пишет:

Quoted 15 lines

The Digital MIC (DMIC) Controller is used to interface with Pulse Density Modulation (PDM) input devices. The DMIC controller implements a converter to convert PDM signals to Pulse Code Modulation (PCM) signals. From signal flow perspective, the DMIC can be viewed as a PDM receiver.

This patch registers DMIC component with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes DMIC interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow to build the driver. The DMIC devices can be enabled in the DT via "nvidia,tegra210-dmic" compatible string. This driver can be used for Tegra186 and Tegra194 chips as well.

---

...

sound/soc/tegra/tegra210_dmic.c line 435

Quoted 5 lines
sound/soc/tegra/tegra210_dmic.c new file +5 -0
+static const struct of_device_id tegra210_dmic_of_match[] = {
+	{ .compatible = "nvidia,tegra210-dmic" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, tegra210_dmic_of_match);

I'd move the tegra210_dmic_of_match close to tegra210_dmic_driver's definition, like most of the other drivers do it.

...

sound/soc/tegra/tegra210_dmic.c line 511

Quoted 10 lines
sound/soc/tegra/tegra210_dmic.c new file +10 -0
+static struct platform_driver tegra210_dmic_driver = {
+	.driver = {
+		.name = "tegra210-dmic",
+		.of_match_table = tegra210_dmic_of_match,
+		.pm = &tegra210_dmic_pm_ops,
+	},
+	.probe = tegra210_dmic_probe,
+	.remove = tegra210_dmic_remove,
+};
+module_platform_driver(tegra210_dmic_driver)

Otherwise:

maintainer
#10 lore raw

Re: [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver

In reply to Sameer Pujar

sound/soc/tegra/tegra210_dmic.c line 5

Quoted 7 lines · Sameer Pujar

+++ b/sound/soc/tegra/tegra210_dmic.c

sound/soc/tegra/tegra210_dmic.c new file +5 -0
@@ -0,0 +1,515 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * tegra210_dmic.c - Tegra210 DMIC driver
+ *
+ * Copyright (c) 2020 NVIDIA CORPORATION.  All rights reserved.

Please make the entire comment a C++ one so things look more intentional.

sound/soc/tegra/tegra210_dmic.c line 27

Quoted 2 lines
sound/soc/tegra/tegra210_dmic.c new file +2 -0
+	/* Below enables all filters - DCR, LP and SC */
+	{ TEGRA210_DMIC_DBG_CTRL, 0xe },

So this isn't the hardware default?

sound/soc/tegra/tegra210_dmic.c line 111

Quoted 3 lines
sound/soc/tegra/tegra210_dmic.c new file +3 -0
+	srate = params_rate(params);
+	if (dmic->srate_override)
+		srate = dmic->srate_override;

How does this work for userspace? If we just ignore the sample rate we were asked for I'd expect that the application would get upset.

Review line 12

Quoted 2 lines
(quoted diff) +2 -0
+	if (strstr(kcontrol->id.name, "Boost Gain"))
+		dmic->boost_gain = value;

Volume controls should end in "Volume".

Review line 14

Quoted 2 lines
(quoted diff) +2 -0
+	else if (strstr(kcontrol->id.name, "Audio Channels"))
+		dmic->audio_ch_override = value;

This is something that would usually come from hw_params?

Review line 16

Quoted 2 lines
(quoted diff) +2 -0
+	else if (strstr(kcontrol->id.name, "LR Polarity Select"))
+		dmic->lrsel = value;

This and some of the others look like they're describing details of how the board is wired up so I'd not expect them to be runtime selectable?

sound/soc/tegra/tegra210_dmic.c line 282

Quoted 1 line
sound/soc/tegra/tegra210_dmic.c new file +1 -0
+	SND_SOC_DAPM_MIC("Dummy Input", NULL),

This is just the microphone that happens to be attached, isn't it? If so that's a weird name.

sound/soc/tegra/tegra210_dmic.c line 301

Quoted 3 lines
sound/soc/tegra/tegra210_dmic.c new file +3 -0
+static const char * const tegra210_dmic_mono_conv_text[] = {
+	"ZERO", "COPY",
+};

It'd be more idiomatic for ALSA to write these as Zero and Copy.

sound/soc/tegra/tegra210_dmic.c line 351

Quoted 8 lines
sound/soc/tegra/tegra210_dmic.c new file +8 -0
+	SOC_ENUM_EXT("Channel Select", tegra210_dmic_ch_enum,
+		     tegra210_dmic_get_control, tegra210_dmic_put_control),
+	SOC_ENUM_EXT("Mono To Stereo",
+		     tegra210_dmic_mono_conv_enum, tegra210_dmic_get_control,
+		     tegra210_dmic_put_control),
+	SOC_ENUM_EXT("Stereo To Mono",
+		     tegra210_dmic_stereo_conv_enum, tegra210_dmic_get_control,
+		     tegra210_dmic_put_control),

I'd expect these to be in DAPM.

maintainer
#11 lore raw

Re: [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver

Quoted 18 lines · Mark Brown

sound/soc/tegra/tegra210_dmic.c line 5

Quoted 7 lines · Sameer Pujar

+++ b/sound/soc/tegra/tegra210_dmic.c

sound/soc/tegra/tegra210_dmic.c new file +5 -0
@@ -0,0 +1,515 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * tegra210_dmic.c - Tegra210 DMIC driver
+ *
+ * Copyright (c) 2020 NVIDIA CORPORATION.  All rights reserved.

Please make the entire comment a C++ one so things look more intentional.

sound/soc/tegra/tegra210_dmic.c line 27

Quoted 2 lines
sound/soc/tegra/tegra210_dmic.c new file +2 -0
+	/* Below enables all filters - DCR, LP and SC */
+	{ TEGRA210_DMIC_DBG_CTRL, 0xe },

So this isn't the hardware default?

Quoted 6 lines

sound/soc/tegra/tegra210_dmic.c line 111

Quoted 3 lines
sound/soc/tegra/tegra210_dmic.c new file +3 -0
+	srate = params_rate(params);
+	if (dmic->srate_override)
+		srate = dmic->srate_override;

How does this work for userspace? If we just ignore the sample rate we were asked for I'd expect that the application would get upset.

Tegra has a hardware sample rate converter (though driver not yet upstream or part of this initial series) and if using the sample-rate converter, then the actual rate captured by the DMIC interface could be different from the resulting sample-rate.

So we want a way to indicate to the DMIC it is capturing at rate X, while the resulting sample-rate is Y.

I am not sure if there is a better way to do this? Ideally, the DMIC would query the rate from the upstream MUX it is connected to, but I am not sure if there is a way to do that. So right now it is a manual process and the user has to configure these which are not ideal.

Cheers
Jon

Signature · 1 line
nvpublic
maintainer
#12 lore raw

Re: [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver

Quoted 9 lines · Jon Hunter
Quoted 6 lines · Mark Brown

sound/soc/tegra/tegra210_dmic.c line 111

Quoted 3 lines
sound/soc/tegra/tegra210_dmic.c new file +3 -0
+	srate = params_rate(params);
+	if (dmic->srate_override)
+		srate = dmic->srate_override;

How does this work for userspace? If we just ignore the sample rate we were asked for I'd expect that the application would get upset.

Quoted 4 lines

Tegra has a hardware sample rate converter (though driver not yet upstream or part of this initial series) and if using the sample-rate converter, then the actual rate captured by the DMIC interface could be different from the resulting sample-rate.

The ideal thing in a component model would be to represent those sample rate convertors directly to usrspace so the routing and rewriting is explicit.

Quoted 7 lines

So we want a way to indicate to the DMIC it is capturing at rate X, while the resulting sample-rate is Y.

I am not sure if there is a better way to do this? Ideally, the DMIC would query the rate from the upstream MUX it is connected to, but I am not sure if there is a way to do that. So right now it is a manual process and the user has to configure these which are not ideal.

Is there any *need* for these to be user configurable? What's normally happening at the minute is that either the external DAIs are fixed configuration and the DSP just converts everything or there's no format conversion done and things get passed through.

maintainer
#13 lore raw

Re: [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver

Quoted 10 lines · Mark Brown
Quoted 8 lines · Jon Hunter
Quoted 6 lines · Mark Brown

sound/soc/tegra/tegra210_dmic.c line 111

Quoted 3 lines
sound/soc/tegra/tegra210_dmic.c new file +3 -0
+	srate = params_rate(params);
+	if (dmic->srate_override)
+		srate = dmic->srate_override;

How does this work for userspace? If we just ignore the sample rate we were asked for I'd expect that the application would get upset.

Quoted 8 lines
Quoted 4 lines

Tegra has a hardware sample rate converter (though driver not yet upstream or part of this initial series) and if using the sample-rate converter, then the actual rate captured by the DMIC interface could be different from the resulting sample-rate.

The ideal thing in a component model would be to represent those sample rate convertors directly to usrspace so the routing and rewriting is explicit.

I assume that it would be OK for the sample rate converter itself to expose mixer controls to configure its input and output rates so the user could configure as needed?

Quoted 8 lines
Quoted 7 lines

So we want a way to indicate to the DMIC it is capturing at rate X, while the resulting sample-rate is Y.

I am not sure if there is a better way to do this? Ideally, the DMIC would query the rate from the upstream MUX it is connected to, but I am not sure if there is a way to do that. So right now it is a manual process and the user has to configure these which are not ideal.

Quoted 4 lines

Is there any *need* for these to be user configurable? What's normally happening at the minute is that either the external DAIs are fixed configuration and the DSP just converts everything or there's no format conversion done and things get passed through.

I can see that in most cases there are a finite set of configurations that the end user may use. However, we would like to make the configuration flexible as possible and this also allow us to test lots of different configurations for verification purposes as well.

So a typical scenario would be ...

DMIC --> SRC --> DMA

Where SRC is the sample-rate converter. Now, the DMICs support upto 48kHz and although it maybe unlikely that someone would want to up convert to say 96kHz, it is possible we can do this with the SRC.

So if the user executes arecord with '-r 96000', the DMIC hw_params would return an error as this is not supported. So today we override this. However, the best solution would be to allow the user the set the input of the SRC and then if the DMIC output is routed via the SRC use the SRC input rate instead of the actual rate seen/specified by the user. So like you said in your other mail, if we could propagate the rate information that would be ideal.

Jon

Signature · 1 line
nvpublic
maintainer
#14 lore raw

Re: [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver

Quoted 9 lines · Jon Hunter
Quoted 3 lines · Mark Brown

The ideal thing in a component model would be to represent those sample rate convertors directly to usrspace so the routing and rewriting is explicit.

I assume that it would be OK for the sample rate converter itself to expose mixer controls to configure its input and output rates so the user could configure as needed?

I don't think so, I'd not expect the individual drivers to be doing anything user visible here - if we know what a digital transformation looks like the framework should be offering anything that's needed to users (and hiding controls that don't have any practical control in a given system).

Quoted 9 lines
Quoted 4 lines

Is there any *need* for these to be user configurable? What's normally happening at the minute is that either the external DAIs are fixed configuration and the DSP just converts everything or there's no format conversion done and things get passed through.

I can see that in most cases there are a finite set of configurations that the end user may use. However, we would like to make the configuration flexible as possible and this also allow us to test lots of different configurations for verification purposes as well.

Internal testing often requires things that can't be exposed to users, the extreme examples are things like battery chargers with health and safety issues if the full range of control is available.

#15 lore raw

Re: Re: [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver

Quoted 5 lines · Mark Brown
Quoted 4 lines · Jon Hunter
Quoted 3 lines · Mark Brown

The ideal thing in a component model would be to represent those sample rate convertors directly to usrspace so the routing and rewriting is explicit.

Quoted 8 lines
Quoted 3 lines

I assume that it would be OK for the sample rate converter itself to expose mixer controls to configure its input and output rates so the user could configure as needed?

I don't think so, I'd not expect the individual drivers to be doing anything user visible here - if we know what a digital transformation looks like the framework should be offering anything that's needed to users (and hiding controls that don't have any practical control in a given system).

Are you suggesting to have some alternate way of users configuring sample rates (and other params) and not use mixer control method?

This is a typical use case we see,
- [stream-1] Lets say high resolution audio is playing (96kHz, 24-bit, stereo)
- [stream-2] Randomly system notifications of small durations come (48kHz, 16-bit, stereo) The requirement is, both streams should be mixed and played.

Tegra Audio HW has Mixer module for mixing multiple streams. In above case, stream-2 requires upsampling to 96kHz (employ SRC) and 24-bit. Then mix with stream1 and play. This needs to be configured at runtime. In another session, mixing for 192kHz and 48kHz might be required with the same audio path. Idea was to allow users to setup their custom path for specific audio applications. In the current series, I am focussing on I/O modules (where overrides do not demonstrate the above use case) and does not include other HW accelerators that Tegra Audio HW offers. Things would be more complicated when user wants to use multiplexers and demultiplexers. For simple use cases overrides are not used.

Is there a better way for user to configure custom audio paths?

Quoted 12 lines
Quoted 9 lines
Quoted 5 lines

Is there any *need* for these to be user configurable? What's normally happening at the minute is that either the external DAIs are fixed configuration and the DSP just converts everything or there's no format conversion done and things get passed through.

I can see that in most cases there are a finite set of configurations that the end user may use. However, we would like to make the configuration flexible as possible and this also allow us to test lots of different configurations for verification purposes as well.

Internal testing often requires things that can't be exposed to users, the extreme examples are things like battery chargers with health and safety issues if the full range of control is available.

maintainer
#16 lore raw

Re: Re: [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver

Quoted 10 lines · Sameer Pujar
Quoted 5 lines · Mark Brown

I don't think so, I'd not expect the individual drivers to be doing anything user visible here - if we know what a digital transformation looks like the framework should be offering anything that's needed to users (and hiding controls that don't have any practical control in a given system).

Are you suggesting to have some alternate way of users configuring sample rates (and other params) and not use mixer control method?

I'm mainly saying the driver shouldn't be doing it directly, it should be doing something much closer to hwparams for digital formats.

Quoted 6 lines

This is a typical use case we see,
- [stream-1] Lets say high resolution audio is playing (96kHz, 24-bit, stereo)
- [stream-2] Randomly system notifications of small durations come (48kHz, 16-bit, stereo)
The requirement is, both streams should be mixed and played.

Most systems like this would run the output at a fixed sample rate here so there'd be no runtime configuration.

Quoted 1 line

Is there a better way for user to configure custom audio paths?

Fit what you're doing into DPCM. It's not particularly great but it's what we have at the minute.

This isn't me not understanding your use case, this is me saying that it would be better to either work like other existing drivers or improve the framework so that it works better for everyone.

#17 lore raw

Re: Re: [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver

In reply to Mark Brown
Quoted 12 lines · Mark Brown

sound/soc/tegra/tegra210_dmic.c line 5

Quoted 7 lines · Sameer Pujar

+++ b/sound/soc/tegra/tegra210_dmic.c

sound/soc/tegra/tegra210_dmic.c new file +5 -0
@@ -0,0 +1,515 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * tegra210_dmic.c - Tegra210 DMIC driver
+ *
+ * Copyright (c) 2020 NVIDIA CORPORATION.  All rights reserved.

Please make the entire comment a C++ one so things look more intentional.

Quoted 3 lines

sound/soc/tegra/tegra210_dmic.c line 27

Quoted 2 lines
sound/soc/tegra/tegra210_dmic.c new file +2 -0
+	/* Below enables all filters - DCR, LP and SC */
+	{ TEGRA210_DMIC_DBG_CTRL, 0xe },

So this isn't the hardware default?

No, the HW default is 0x2. Also, we are repurposing the LP filter for applying gain.

Quoted 7 lines

sound/soc/tegra/tegra210_dmic.c line 111

Quoted 4 lines
sound/soc/tegra/tegra210_dmic.c new file +3 -0
+	srate = params_rate(params);
+	if (dmic->srate_override)
+		srate = dmic->srate_override;

How does this work for userspace? If we just ignore the sample rate we were asked for I'd expect that the application would get upset.

Quoted 7 lines

Review line 12

Quoted 2 lines
(quoted diff) +2 -0
+	if (strstr(kcontrol->id.name, "Boost Gain"))
+		dmic->boost_gain = value;

Volume controls should end in "Volume".

Review line 14

Quoted 2 lines
(quoted diff) +2 -0
+	else if (strstr(kcontrol->id.name, "Audio Channels"))
+		dmic->audio_ch_override = value;

This is something that would usually come from hw_params?

Yes, hw_params is where it is taken from. The additional override is optional and would not usually need to be set by user. However, we have certain other modules, like multiplexer and demultiplexer (proposed to be upstreamed in the near future), where no. of channels get changed at the output. When one or more such modules are connected in the path, hw_params does not reflect the channels post multiplex/demultiplex, hence this override would be needed.

Quoted 5 lines

Review line 16

Quoted 3 lines
(quoted diff) +2 -0
+	else if (strstr(kcontrol->id.name, "LR Polarity Select"))
+		dmic->lrsel = value;

This and some of the others look like they're describing details of how the board is wired up so I'd not expect them to be runtime selectable?

No, these are not board wiring. OSR, polarity, etc. are configurable within the DMIC (within Tegra). Of course, these controls are optional and the default works just fine. Also, to clarify here, 'runtime selectable' does not mean these parameters can be modified while a recording session is in progress. These parameters (optional) need to set up before a session is started. User can close the recording, reconfigure the parameters, then start a new session, without needing reboot.

Quoted 4 lines

sound/soc/tegra/tegra210_dmic.c line 282

Quoted 2 lines
sound/soc/tegra/tegra210_dmic.c new file +1 -0
+	SND_SOC_DAPM_MIC("Dummy Input", NULL),

This is just the microphone that happens to be attached, isn't it? If so that's a weird name.

It is not necessary for an actual mic to be connected to the pin. Recording will work even when the pin is left open, capture being silence. All the drivers, whether for playback or for capture, work OK even without any physical end-point, hence the "dummy" I/O.

Quoted 6 lines

sound/soc/tegra/tegra210_dmic.c line 301

Quoted 4 lines
sound/soc/tegra/tegra210_dmic.c new file +3 -0
+static const char * const tegra210_dmic_mono_conv_text[] = {
+	"ZERO", "COPY",
+};

It'd be more idiomatic for ALSA to write these as Zero and Copy.

Quoted 9 lines

sound/soc/tegra/tegra210_dmic.c line 351

Quoted 8 lines
sound/soc/tegra/tegra210_dmic.c new file +8 -0
+	SOC_ENUM_EXT("Channel Select", tegra210_dmic_ch_enum,
+		     tegra210_dmic_get_control, tegra210_dmic_put_control),
+	SOC_ENUM_EXT("Mono To Stereo",
+		     tegra210_dmic_mono_conv_enum, tegra210_dmic_get_control,
+		     tegra210_dmic_put_control),
+	SOC_ENUM_EXT("Stereo To Mono",
+		     tegra210_dmic_stereo_conv_enum, tegra210_dmic_get_control,
+		     tegra210_dmic_put_control),

I'd expect these to be in DAPM.

These are finer controls and I would guess are outside what can be described by DAPM. E.g. - say the user wants mono capture, but the board has stereo mics connected. Default configuration is that the Left channel would be propagated. The stereo_to_mono option offers additional control - to select the Right channel, or mix L and R into one. As mentioned earlier, much of the controls here are not necessary to be set for a basic use case to work. These are advanced settings.

#18 lore raw

PATCH v3 4/10 ASoC: tegra: add Tegra210 based I2S driver

In reply to Sameer Pujar

The Inter-IC Sound (I2S) controller implements full-duplex, bi-directional and single direction point to point serial interface. It can interface with I2S compatible devices. Tegra I2S controller can operate as both master and slave.

This patch registers I2S controller with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes I2S interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow to build the driver. The I2S devices can be enabled in the DT via "nvidia,tegra210-i2s" compatible binding.

---
 sound/soc/tegra/Kconfig        |  10 +
 sound/soc/tegra/Makefile       |   2 +
 sound/soc/tegra/tegra210_i2s.c | 938 +++++++++++++++++++++++++++++++++++++++++
 sound/soc/tegra/tegra210_i2s.h | 132 ++++++
 4 files changed, 1082 insertions(+)
 create mode 100644 sound/soc/tegra/tegra210_i2s.c
 create mode 100644 sound/soc/tegra/tegra210_i2s.h
sound/soc/tegra/Kconfig +10 -0
index 2bde1e6..157fa7a 100644
@@ -73,6 +73,16 @@ config SND_SOC_TEGRA210_DMIC
           PDM receiver.
           Say Y or M if you want to add support for Tegra210 DMIC module.
 
+config SND_SOC_TEGRA210_I2S
+        tristate "Tegra210 I2S module"
+        depends on SND_SOC_TEGRA
+        help
+          Config to enable the Inter-IC Sound (I2S) Controller which
+          implements full-duplex and bidirectional and single direction
+          point-to-point serial interfaces. It can interface with I2S
+          compatible devices.
+          Say Y or M if you want to add support for Tegra210 I2S module.
+
 config SND_SOC_TEGRA_RT5640
 	tristate "SoC Audio support for Tegra boards using an RT5640 codec"
 	depends on SND_SOC_TEGRA && I2C && GPIOLIB
sound/soc/tegra/Makefile +2 -0
index f0690cf..e30f6a3 100644
@@ -9,6 +9,7 @@ snd-soc-tegra20-spdif-objs := tegra20_spdif.o
 snd-soc-tegra30-ahub-objs := tegra30_ahub.o
 snd-soc-tegra30-i2s-objs := tegra30_i2s.o
 snd-soc-tegra210-dmic-objs := tegra210_dmic.o
+snd-soc-tegra210-i2s-objs := tegra210_i2s.o
 
 obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-pcm.o
 obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-utils.o
@@ -19,6 +20,7 @@ obj-$(CONFIG_SND_SOC_TEGRA20_SPDIF) += snd-soc-tegra20-spdif.o
 obj-$(CONFIG_SND_SOC_TEGRA30_AHUB) += snd-soc-tegra30-ahub.o
 obj-$(CONFIG_SND_SOC_TEGRA30_I2S) += snd-soc-tegra30-i2s.o
 obj-$(CONFIG_SND_SOC_TEGRA210_DMIC) += snd-soc-tegra210-dmic.o
+obj-$(CONFIG_SND_SOC_TEGRA210_I2S) += snd-soc-tegra210-i2s.o
 
 # Tegra machine Support
 snd-soc-tegra-rt5640-objs := tegra_rt5640.o
sound/soc/tegra/tegra210_i2s.c new file +938 -0

938 lines not on this page · raw message

sound/soc/tegra/tegra210_i2s.h new file +132 -0

132 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer Reviewed-by on v3 4/10
#19 lore raw

Re: [PATCH v3 04/10] ASoC: tegra: add Tegra210 based I2S driver

Quoted 13 lines · Sameer Pujar

The Inter-IC Sound (I2S) controller implements full-duplex, bi-directional and single direction point to point serial interface. It can interface with I2S compatible devices. Tegra I2S controller can operate as both master and slave.

This patch registers I2S controller with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes I2S interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow to build the driver. The I2S devices can be enabled in the DT via "nvidia,tegra210-i2s" compatible binding.

Quoted 8 lines
---
 sound/soc/tegra/Kconfig        |  10 +
 sound/soc/tegra/Makefile       |   2 +
 sound/soc/tegra/tegra210_i2s.c | 938 +++++++++++++++++++++++++++++++++++++++++
 sound/soc/tegra/tegra210_i2s.h | 132 ++++++
 4 files changed, 1082 insertions(+)
 create mode 100644 sound/soc/tegra/tegra210_i2s.c
 create mode 100644 sound/soc/tegra/tegra210_i2s.h

Thanks!

Cheers
Jon

Signature · 1 line
nvpublic
maintainer
#20 lore raw

Re: [PATCH v3 04/10] ASoC: tegra: add Tegra210 based I2S driver

In reply to Sameer Pujar

sound/soc/tegra/tegra210_i2s.c line 4

Quoted 5 lines · Sameer Pujar
sound/soc/tegra/tegra210_i2s.c new file +4 -0
@@ -0,0 +1,938 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * tegra210_i2s.c - Tegra210 I2S driver
+ *

All C++ please.

sound/soc/tegra/tegra210_i2s.c line 209

Quoted 12 lines
sound/soc/tegra/tegra210_i2s.c new file +12 -0
+static void tegra210_i2s_set_data_offset(struct tegra210_i2s *i2s,
+					 unsigned int data_offset)
+{
+	unsigned int mask = I2S_CTRL_DATA_OFFSET_MASK;
+	unsigned int shift = I2S_DATA_SHIFT;
+	unsigned int reg;
+
+	reg = TEGRA210_I2S_TX_CTRL;
+	regmap_update_bits(i2s->regmap, reg, mask, data_offset << shift);
+
+	reg = TEGRA210_I2S_RX_CTRL;
+	regmap_update_bits(i2s->regmap, reg, mask, data_offset << shift);

The way this is written is *weird*, especially the use of reg - it'd probably be clearer to just use the values directly rather than have these intermediate temporary values.

Quoted 7 lines
sound/soc/tegra/tegra210_i2s.c new file +7 -0
+static int tegra210_i2s_get_control(struct snd_kcontrol *kcontrol,
+				    struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol);
+	struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt);
+	long *uctl_val = &ucontrol->value.integer.value[0];
+

sound/soc/tegra/tegra210_i2s.c line 333

Quoted 10 lines
sound/soc/tegra/tegra210_i2s.c new file +10 -0
+	if (strstr(kcontrol->id.name, "Loopback"))
+		*uctl_val = i2s->loopback;
+	else if (strstr(kcontrol->id.name, "Sample Rate"))
+		*uctl_val = i2s->srate_override;
+	else if (strstr(kcontrol->id.name, "FSYNC Width"))
+		*uctl_val = i2s->fsync_width;
+	else if (strstr(kcontrol->id.name, "Playback Audio Bit Format"))
+		*uctl_val = i2s->audio_fmt_override[I2S_RX_PATH];
+	else if (strstr(kcontrol->id.name, "Capture Audio Bit Format"))
+		*uctl_val = i2s->audio_fmt_override[I2S_TX_PATH];

Same issue as the DMIC driver, these really shouldn't be exposed to userspace as regular controls.

sound/soc/tegra/tegra210_i2s.c line 575

Quoted 7 lines
sound/soc/tegra/tegra210_i2s.c new file +7 -0
+	/*
+	 * For playback I2S RX-CIF and for capture TX-CIF is used.
+	 * With reference to AHUB, for I2S, SNDRV_PCM_STREAM_CAPTURE stream is
+	 * actually for playback.
+	 */
+	path = (substream->stream == SNDRV_PCM_STREAM_CAPTURE) ?
+	       I2S_RX_PATH : I2S_TX_PATH;

Please write normal conditional statements, it makes things easier to read.

#21 lore raw

PATCH v3 5/10 ASoC: tegra: add Tegra210 based AHUB driver

In reply to Sameer Pujar

The Audio Hub (AHUB) comprises a collection of hardware accelerators for audio pre/post-processing and a programmable full crossbar (XBAR) for routing audio data across these accelerators in time and in parallel. AHUB supports multiple interfaces to I2S, DSPK, DMIC etc., XBAR is a switch used to configure or modify audio routing between HW accelerators present inside AHUB.

This patch registers AHUB component with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes AHUB interfaces, which can be used to connect different components in the ASoC layer. Currently the driver takes care of XBAR programming to allow audio data flow through various clients of the AHUB. Makefile and Kconfig support is added to allow to build the driver. The AHUB component can be enabled in the DT via below compatible bindings.
- "nvidia,tegra210-ahub" for Tegra210
- "nvidia,tegra186-ahub" for Tegra186 and Tegra194

---
 sound/soc/tegra/Kconfig         |  10 +
 sound/soc/tegra/Makefile        |   2 +
 sound/soc/tegra/tegra210_ahub.c | 651 ++++++++++++++++++++++++++++++++++++++++
 sound/soc/tegra/tegra210_ahub.h | 125 ++++++++
 4 files changed, 788 insertions(+)
 create mode 100644 sound/soc/tegra/tegra210_ahub.c
 create mode 100644 sound/soc/tegra/tegra210_ahub.h
sound/soc/tegra/Kconfig +10 -0
index 157fa7a..0c07f63 100644
@@ -62,6 +62,16 @@ config SND_SOC_TEGRA30_I2S
 	  Tegra30 I2S interface. You will also need to select the individual
 	  machine drivers to support below.
 
+config SND_SOC_TEGRA210_AHUB
+        tristate "Tegra210 AHUB module"
+        depends on SND_SOC_TEGRA
+        help
+	  Config to enable Audio Hub (AHUB) module, which comprises of a
+	  switch called Audio Crossbar (AXBAR) used to configure or modify
+	  the audio routing path between various HW accelerators present in
+	  AHUB.
+          Say Y or M if you want to add support for Tegra210 AHUB module.
+
 config SND_SOC_TEGRA210_DMIC
         tristate "Tegra210 DMIC module"
         depends on SND_SOC_TEGRA
sound/soc/tegra/Makefile +2 -0
index e30f6a3..b01d88e 100644
@@ -8,6 +8,7 @@ snd-soc-tegra20-i2s-objs := tegra20_i2s.o
 snd-soc-tegra20-spdif-objs := tegra20_spdif.o
 snd-soc-tegra30-ahub-objs := tegra30_ahub.o
 snd-soc-tegra30-i2s-objs := tegra30_i2s.o
+snd-soc-tegra210-ahub-objs := tegra210_ahub.o
 snd-soc-tegra210-dmic-objs := tegra210_dmic.o
 snd-soc-tegra210-i2s-objs := tegra210_i2s.o
 
@@ -20,6 +21,7 @@ obj-$(CONFIG_SND_SOC_TEGRA20_SPDIF) += snd-soc-tegra20-spdif.o
 obj-$(CONFIG_SND_SOC_TEGRA30_AHUB) += snd-soc-tegra30-ahub.o
 obj-$(CONFIG_SND_SOC_TEGRA30_I2S) += snd-soc-tegra30-i2s.o
 obj-$(CONFIG_SND_SOC_TEGRA210_DMIC) += snd-soc-tegra210-dmic.o
+obj-$(CONFIG_SND_SOC_TEGRA210_AHUB) += snd-soc-tegra210-ahub.o
 obj-$(CONFIG_SND_SOC_TEGRA210_I2S) += snd-soc-tegra210-i2s.o
 
 # Tegra machine Support
sound/soc/tegra/tegra210_ahub.c new file +651 -0

651 lines not on this page · raw message

sound/soc/tegra/tegra210_ahub.h new file +125 -0

125 lines not on this page · raw message

Signature · 1 line
2.7.4
#22 lore raw

Re: [PATCH v3 05/10] ASoC: tegra: add Tegra210 based AHUB driver

Quoted 11 lines · Sameer Pujar
sound/soc/tegra/Kconfig +3 -0
index 157fa7a..0c07f63 100644
@@ -62,6 +62,16 @@ config SND_SOC_TEGRA30_I2S
 	  Tegra30 I2S interface. You will also need to select the individual
 	  machine drivers to support below.
 
+config SND_SOC_TEGRA210_AHUB
+        tristate "Tegra210 AHUB module"
+        depends on SND_SOC_TEGRA

sound/soc/tegra/Kconfig config SND_SOC_TEGRA30_I2S · line 77

Quoted 10 lines
sound/soc/tegra/Kconfig +7 -0
+        help
+	  Config to enable Audio Hub (AHUB) module, which comprises of a
+	  switch called Audio Crossbar (AXBAR) used to configure or modify
+	  the audio routing path between various HW accelerators present in
+	  AHUB.
+          Say Y or M if you want to add support for Tegra210 AHUB module.
+
 config SND_SOC_TEGRA210_DMIC
         tristate "Tegra210 DMIC module"
         depends on SND_SOC_TEGRA

Please fix above according to Documentation/process/coding-style.rst:

10) Kconfig configuration files
-------------------------------

For all of the Kconfig* configuration files throughout the source tree, the indentation is somewhat different. Lines under a ``config`` definition are indented with one tab, while help text is indented an additional two spaces.

Signature · 1 line
~Randy
maintainer Reviewed-by on v3 5/10
#23 lore raw

Re: [PATCH v3 05/10] ASoC: tegra: add Tegra210 based AHUB driver

In reply to Sameer Pujar
Quoted 18 lines · Sameer Pujar

The Audio Hub (AHUB) comprises a collection of hardware accelerators for audio pre/post-processing and a programmable full crossbar (XBAR) for routing audio data across these accelerators in time and in parallel. AHUB supports multiple interfaces to I2S, DSPK, DMIC etc., XBAR is a switch used to configure or modify audio routing between HW accelerators present inside AHUB.

This patch registers AHUB component with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes AHUB interfaces, which can be used to connect different components in the ASoC layer. Currently the driver takes care of XBAR programming to allow audio data flow through various clients of the AHUB. Makefile and Kconfig support is added to allow to build the driver. The AHUB component can be enabled in the DT via below compatible bindings.
- "nvidia,tegra210-ahub" for Tegra210
- "nvidia,tegra186-ahub" for Tegra186 and Tegra194

Quoted 8 lines
---
 sound/soc/tegra/Kconfig         |  10 +
 sound/soc/tegra/Makefile        |   2 +
 sound/soc/tegra/tegra210_ahub.c | 651 ++++++++++++++++++++++++++++++++++++++++
 sound/soc/tegra/tegra210_ahub.h | 125 ++++++++
 4 files changed, 788 insertions(+)
 create mode 100644 sound/soc/tegra/tegra210_ahub.c
 create mode 100644 sound/soc/tegra/tegra210_ahub.h

Aside from Randy's comment ...

Cheers
Jon

Signature · 1 line
nvpublic
maintainer
#24 lore raw

Re: [PATCH v3 05/10] ASoC: tegra: add Tegra210 based AHUB driver

In reply to Sameer Pujar
Quoted 7 lines · Sameer Pujar

The Audio Hub (AHUB) comprises a collection of hardware accelerators for audio pre/post-processing and a programmable full crossbar (XBAR) for routing audio data across these accelerators in time and in parallel. AHUB supports multiple interfaces to I2S, DSPK, DMIC etc., XBAR is a switch used to configure or modify audio routing between HW accelerators present inside AHUB.

Quoted 5 lines

This patch registers AHUB component with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes AHUB interfaces, which can be used to connect different components in the ASoC layer. Currently the driver takes care of XBAR programming to allow audio data flow through various clients of the AHUB.

The current way to represent complex digitial routing inside SoCs is to use DPCM, this is not great and causes a bunch of problems with the framework but it's at least consistent between SoCs and is less visible to the ABI than this is. Ideally what we'd be doing is propagating digital configuration along audio paths like we do for analog with DAPM, Morimoto-san has done a lot of the groundwork for doing that with converting everything to components but nobody has worked on that yet. Your stuff looks a lot more like this than it does DPCM at the minute but it completely sidesteps the digital configuration part of things without trying to integrate with the framework which isn't great.

I'm really not thrilled about the idea of just hacking around the side of things like this is doing, the ideal thing would be starting the work on the framework to propagate digital configuration - I *think* you can get away with only a subset of the problem here (just copying configuration straight through) since this looks like it's just straight point to point links with little in the way of DSP. If not DPCM would be the way to go I think.

#25 lore raw

PATCH v3 6/10 ASoC: tegra: add Tegra186 based DSPK driver

In reply to Sameer Pujar

The Digital Speaker Controller (DSPK) converts the multi-bit Pulse Code Modulation (PCM) audio input to oversampled 1-bit Pulse Density Modulation (PDM) output. From the signal flow perpsective, the DSPK can be viewed as a PDM transmitter that up-samples the input to the desired sampling rate by interpolation then converts the oversampled PCM input to the desired 1-bit output via Delta Sigma Modulation (DSM).

This patch registers DSPK component with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes DSPK interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow to build the driver. The DSPK devices can be enabled in the DT via "nvidia,tegra186-dspk" compatible binding. This driver can be used on Tegra194 chip as well.

---
 sound/soc/tegra/Kconfig         |  13 +
 sound/soc/tegra/Makefile        |   2 +
 sound/soc/tegra/tegra186_dspk.c | 510 ++++++++++++++++++++++++++++++++++++++++
 sound/soc/tegra/tegra186_dspk.h |  73 ++++++
 4 files changed, 598 insertions(+)
 create mode 100644 sound/soc/tegra/tegra186_dspk.c
 create mode 100644 sound/soc/tegra/tegra186_dspk.h
sound/soc/tegra/Kconfig +13 -0
index 0c07f63..fb77df3 100644
@@ -93,6 +93,19 @@ config SND_SOC_TEGRA210_I2S
           compatible devices.
           Say Y or M if you want to add support for Tegra210 I2S module.
 
+config SND_SOC_TEGRA186_DSPK
+        tristate "Tegra186 DSPK module"
+        depends on SND_SOC_TEGRA
+        help
+          Config to enable the Digital Speaker Controller (DSPK) which
+          converts the multi-bit Pulse Code Modulation (PCM) audio input to
+          oversampled 1-bit Pulse Desnity Modulation (PDM) output. From the
+          signal flow perspective DSPK can be viewed as a PDM transmitter
+          that up-samples the input to the desired sampling rate by
+          interpolation and then converts the oversampled PCM input to
+          the desired 1-bit output via Delta Sigma Modulation (DSM).
+          Say Y or M if you want to add support for Tegra186 DSPK module.
+
 config SND_SOC_TEGRA_RT5640
 	tristate "SoC Audio support for Tegra boards using an RT5640 codec"
 	depends on SND_SOC_TEGRA && I2C && GPIOLIB
sound/soc/tegra/Makefile +2 -0
index b01d88e..336c4c7 100644
@@ -11,6 +11,7 @@ snd-soc-tegra30-i2s-objs := tegra30_i2s.o
 snd-soc-tegra210-ahub-objs := tegra210_ahub.o
 snd-soc-tegra210-dmic-objs := tegra210_dmic.o
 snd-soc-tegra210-i2s-objs := tegra210_i2s.o
+snd-soc-tegra186-dspk-objs := tegra186_dspk.o
 
 obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-pcm.o
 obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-utils.o
@@ -23,6 +24,7 @@ obj-$(CONFIG_SND_SOC_TEGRA30_I2S) += snd-soc-tegra30-i2s.o
 obj-$(CONFIG_SND_SOC_TEGRA210_DMIC) += snd-soc-tegra210-dmic.o
 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
 
 # Tegra machine Support
 snd-soc-tegra-rt5640-objs := tegra_rt5640.o
sound/soc/tegra/tegra186_dspk.c new file +510 -0

510 lines not on this page · raw message

sound/soc/tegra/tegra186_dspk.h new file +73 -0

73 lines not on this page · raw message

Signature · 1 line
2.7.4
#26 lore raw

Re: [PATCH v3 06/10] ASoC: tegra: add Tegra186 based DSPK driver

Quoted 5 lines · Sameer Pujar
sound/soc/tegra/Kconfig +0 -0
index 0c07f63..fb77df3 100644

sound/soc/tegra/Kconfig config SND_SOC_TEGRA210_I2S · line 102

Quoted 10 lines
sound/soc/tegra/Kconfig +7 -0
@@ -93,6 +93,19 @@ config SND_SOC_TEGRA210_I2S
           compatible devices.
           Say Y or M if you want to add support for Tegra210 I2S module.
 
+config SND_SOC_TEGRA186_DSPK
+        tristate "Tegra186 DSPK module"
+        depends on SND_SOC_TEGRA
+        help
+          Config to enable the Digital Speaker Controller (DSPK) which
+          converts the multi-bit Pulse Code Modulation (PCM) audio input to
+          oversampled 1-bit Pulse Desnity Modulation (PDM) output. From the

Density

sound/soc/tegra/Kconfig config SND_SOC_TEGRA210_I2S · line 107

Quoted 5 lines
sound/soc/tegra/Kconfig +5 -0
+          signal flow perspective DSPK can be viewed as a PDM transmitter
+          that up-samples the input to the desired sampling rate by
+          interpolation and then converts the oversampled PCM input to
+          the desired 1-bit output via Delta Sigma Modulation (DSM).
+          Say Y or M if you want to add support for Tegra186 DSPK module.

Please fix indentation according to coding style.
Thanks.

Quoted 4 lines
sound/soc/tegra/Kconfig +1 -0
+
 config SND_SOC_TEGRA_RT5640
 	tristate "SoC Audio support for Tegra boards using an RT5640 codec"
 	depends on SND_SOC_TEGRA && I2C && GPIOLIB
Signature · 1 line
~Randy
maintainer Reviewed-by on v3 6/10
#27 lore raw

Re: [PATCH v3 06/10] ASoC: tegra: add Tegra186 based DSPK driver

In reply to Sameer Pujar
Quoted 16 lines · Sameer Pujar

The Digital Speaker Controller (DSPK) converts the multi-bit Pulse Code Modulation (PCM) audio input to oversampled 1-bit Pulse Density Modulation (PDM) output. From the signal flow perpsective, the DSPK can be viewed as a PDM transmitter that up-samples the input to the desired sampling rate by interpolation then converts the oversampled PCM input to the desired 1-bit output via Delta Sigma Modulation (DSM).

This patch registers DSPK component with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes DSPK interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow to build the driver. The DSPK devices can be enabled in the DT via "nvidia,tegra186-dspk" compatible binding. This driver can be used on Tegra194 chip as well.

Quoted 8 lines
---
 sound/soc/tegra/Kconfig         |  13 +
 sound/soc/tegra/Makefile        |   2 +
 sound/soc/tegra/tegra186_dspk.c | 510 ++++++++++++++++++++++++++++++++++++++++
 sound/soc/tegra/tegra186_dspk.h |  73 ++++++
 4 files changed, 598 insertions(+)
 create mode 100644 sound/soc/tegra/tegra186_dspk.c
 create mode 100644 sound/soc/tegra/tegra186_dspk.h

Aside from Randy's comment ...

Cheers
Jon

Signature · 1 line
nvpublic
#28 lore raw

PATCH v3 7/10 ASoC: tegra: add Tegra210 based ADMAIF driver

In reply to Sameer Pujar

ADMAIF is the interface between ADMA and AHUB. Each ADMA channel that sends/receives data to/from AHUB must intreface through an ADMAIF channel. ADMA channel sending data to AHUB pairs with an ADMAIF Tx channel and similarly ADMA channel receiving data from AHUB pairs with an ADMAIF Rx channel. Buffer size is configuranle for each ADMAIF channel, but currently SW uses default values.

This patch registers ADMAIF driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes ADMAIF interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow to build the driver. The ADMAIF device can be enabled in the DT via "nvidia,tegra210-admaif" compatible binding.

Tegra PCM driver is updated to expose required PCM interfaces and snd_pcm_ops callbacks.

---
 sound/soc/tegra/Kconfig           |  12 +
 sound/soc/tegra/Makefile          |   2 +
 sound/soc/tegra/tegra210_admaif.c | 884 ++++++++++++++++++++++++++++++++++++++
 sound/soc/tegra/tegra210_admaif.h | 164 +++++++
 sound/soc/tegra/tegra_pcm.c       | 222 +++++++++-
 sound/soc/tegra/tegra_pcm.h       |  23 +-
 6 files changed, 1305 insertions(+), 2 deletions(-)
 create mode 100644 sound/soc/tegra/tegra210_admaif.c
 create mode 100644 sound/soc/tegra/tegra210_admaif.h
sound/soc/tegra/Kconfig +12 -0
index fb77df3..c0a5f0b 100644
@@ -106,6 +106,18 @@ config SND_SOC_TEGRA186_DSPK
           the desired 1-bit output via Delta Sigma Modulation (DSM).
           Say Y or M if you want to add support for Tegra186 DSPK module.
 
+config SND_SOC_TEGRA210_ADMAIF
+        tristate "Tegra210 ADMAIF module"
+        depends on SND_SOC_TEGRA
+        help
+          Config to enable ADMAIF which is the interface between ADMA and
+          Audio Hub (AHUB). Each ADMA channel that sends/receives data to/
+          from AHUB must interface through an ADMAIF channel. ADMA channel
+          sending data to AHUB pairs with an ADMAIF Tx channel, where as
+          ADMA channel receiving data from AHUB pairs with an ADMAIF Rx
+          channel. Buffer size is confiigurable for each ADMAIIF channel.
+          Say Y or M if you want to add support for Tegra210 ADMAIF module.
+
 config SND_SOC_TEGRA_RT5640
 	tristate "SoC Audio support for Tegra boards using an RT5640 codec"
 	depends on SND_SOC_TEGRA && I2C && GPIOLIB
sound/soc/tegra/Makefile +2 -0
index 336c4c7..60040a0 100644
@@ -12,6 +12,7 @@ snd-soc-tegra210-ahub-objs := tegra210_ahub.o
 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
 
 obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-pcm.o
 obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-utils.o
@@ -25,6 +26,7 @@ obj-$(CONFIG_SND_SOC_TEGRA210_DMIC) += snd-soc-tegra210-dmic.o
 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
 
 # Tegra machine Support
 snd-soc-tegra-rt5640-objs := tegra_rt5640.o
sound/soc/tegra/tegra210_admaif.c new file +884 -0

884 lines not on this page · raw message

sound/soc/tegra/tegra210_admaif.h new file +164 -0

164 lines not on this page · raw message

sound/soc/tegra/tegra_pcm.c +221 -1

239 lines not on this page · raw message

sound/soc/tegra/tegra_pcm.h +22 -1
index 0433372..fe138a4 100644
@@ -17,8 +17,29 @@
 #ifndef __TEGRA_PCM_H__
 #define __TEGRA_PCM_H__
 
-struct snd_dmaengine_pcm_config;
+#include <sound/dmaengine_pcm.h>
+#include <sound/asound.h>
 
+int tegra_pcm_construct(struct snd_soc_component *component,
+			struct snd_soc_pcm_runtime *rtd);
+void tegra_pcm_destruct(struct snd_soc_component *component,
+			struct snd_pcm *pcm);
+int tegra_pcm_open(struct snd_soc_component *component,
+		   struct snd_pcm_substream *substream);
+int tegra_pcm_close(struct snd_soc_component *component,
+		    struct snd_pcm_substream *substream);
+int tegra_pcm_hw_params(struct snd_soc_component *component,
+			struct snd_pcm_substream *substream,
+			struct snd_pcm_hw_params *params);
+int tegra_pcm_hw_free(struct snd_soc_component *component,
+		      struct snd_pcm_substream *substream);
+int tegra_pcm_mmap(struct snd_soc_component *component,
+		   struct snd_pcm_substream *substream,
+		   struct vm_area_struct *vma);
+int tegra_pcm_trigger(struct snd_soc_component *component,
+		      struct snd_pcm_substream *substream, int cmd);
+snd_pcm_uframes_t tegra_pcm_pointer(struct snd_soc_component *component,
+				    struct snd_pcm_substream *substream);
 int tegra_pcm_platform_register(struct device *dev);
 int tegra_pcm_platform_register_with_chan_names(struct device *dev,
 				struct snd_dmaengine_pcm_config *config,
Signature · 1 line
2.7.4
#29 lore raw

Re: [PATCH v3 07/10] ASoC: tegra: add Tegra210 based ADMAIF driver

Quoted 8 lines · Sameer Pujar
sound/soc/tegra/Kconfig +0 -0
index fb77df3..c0a5f0b 100644
@@ -106,6 +106,18 @@ config SND_SOC_TEGRA186_DSPK
           the desired 1-bit output via Delta Sigma Modulation (DSM).
           Say Y or M if you want to add support for Tegra186 DSPK module.
 

sound/soc/tegra/Kconfig config SND_SOC_TEGRA186_DSPK · line 118

Quoted 10 lines
sound/soc/tegra/Kconfig +10 -0
+config SND_SOC_TEGRA210_ADMAIF
+        tristate "Tegra210 ADMAIF module"
+        depends on SND_SOC_TEGRA
+        help
+          Config to enable ADMAIF which is the interface between ADMA and
+          Audio Hub (AHUB). Each ADMA channel that sends/receives data to/
+          from AHUB must interface through an ADMAIF channel. ADMA channel
+          sending data to AHUB pairs with an ADMAIF Tx channel, where as
+          ADMA channel receiving data from AHUB pairs with an ADMAIF Rx
+          channel. Buffer size is confiigurable for each ADMAIIF channel.

configurable

sound/soc/tegra/Kconfig config SND_SOC_TEGRA186_DSPK · line 119

Quoted 1 line
sound/soc/tegra/Kconfig +1 -0
+          Say Y or M if you want to add support for Tegra210 ADMAIF module.

Please fix indentation according to coding style.

Quoted 4 lines
sound/soc/tegra/Kconfig +1 -0
+
 config SND_SOC_TEGRA_RT5640
 	tristate "SoC Audio support for Tegra boards using an RT5640 codec"
 	depends on SND_SOC_TEGRA && I2C && GPIOLIB
Signature · 1 line
~Randy
maintainer Reviewed-by on v3 7/10
#30 lore raw

Re: [PATCH v3 07/10] ASoC: tegra: add Tegra210 based ADMAIF driver

In reply to Sameer Pujar
Quoted 18 lines · Sameer Pujar

ADMAIF is the interface between ADMA and AHUB. Each ADMA channel that sends/receives data to/from AHUB must intreface through an ADMAIF channel. ADMA channel sending data to AHUB pairs with an ADMAIF Tx channel and similarly ADMA channel receiving data from AHUB pairs with an ADMAIF Rx channel. Buffer size is configuranle for each ADMAIF channel, but currently SW uses default values.

This patch registers ADMAIF driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes ADMAIF interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow to build the driver. The ADMAIF device can be enabled in the DT via "nvidia,tegra210-admaif" compatible binding.

Tegra PCM driver is updated to expose required PCM interfaces and snd_pcm_ops callbacks.

Quoted 10 lines
---
 sound/soc/tegra/Kconfig           |  12 +
 sound/soc/tegra/Makefile          |   2 +
 sound/soc/tegra/tegra210_admaif.c | 884 ++++++++++++++++++++++++++++++++++++++
 sound/soc/tegra/tegra210_admaif.h | 164 +++++++
 sound/soc/tegra/tegra_pcm.c       | 222 +++++++++-
 sound/soc/tegra/tegra_pcm.h       |  23 +-
 6 files changed, 1305 insertions(+), 2 deletions(-)
 create mode 100644 sound/soc/tegra/tegra210_admaif.c
 create mode 100644 sound/soc/tegra/tegra210_admaif.h

Aside from Randy's comment ...

Cheers
Jon

Signature · 1 line
nvpublic
#31 lore raw

Re: [PATCH v3 07/10] ASoC: tegra: add Tegra210 based ADMAIF driver

In reply to Sameer Pujar

20.02.2020 09:34, Sameer Pujar пишет:

Quoted 19 lines

ADMAIF is the interface between ADMA and AHUB. Each ADMA channel that sends/receives data to/from AHUB must intreface through an ADMAIF channel. ADMA channel sending data to AHUB pairs with an ADMAIF Tx channel and similarly ADMA channel receiving data from AHUB pairs with an ADMAIF Rx channel. Buffer size is configuranle for each ADMAIF channel, but currently SW uses default values.

This patch registers ADMAIF driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes ADMAIF interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow to build the driver. The ADMAIF device can be enabled in the DT via "nvidia,tegra210-admaif" compatible binding.

Tegra PCM driver is updated to expose required PCM interfaces and snd_pcm_ops callbacks.

---

...

Quoted 9 lines
sound/soc/tegra/tegra_pcm.h +9 -0
+int tegra_pcm_construct(struct snd_soc_component *component,
+			struct snd_soc_pcm_runtime *rtd);
+void tegra_pcm_destruct(struct snd_soc_component *component,
+			struct snd_pcm *pcm);
+int tegra_pcm_open(struct snd_soc_component *component,
+		   struct snd_pcm_substream *substream);
+int tegra_pcm_close(struct snd_soc_component *component,
+		    struct snd_pcm_substream *substream);
+int tegra_pcm_hw_params(struct snd_soc_component *component,

sound/soc/tegra/tegra_pcm.h line 40

Quoted 10 lines
sound/soc/tegra/tegra_pcm.h +9 -0
+			struct snd_pcm_substream *substream,
+			struct snd_pcm_hw_params *params);
+int tegra_pcm_hw_free(struct snd_soc_component *component,
+		      struct snd_pcm_substream *substream);
+int tegra_pcm_mmap(struct snd_soc_component *component,
+		   struct snd_pcm_substream *substream,
+		   struct vm_area_struct *vma);
 
+int tegra_pcm_trigger(struct snd_soc_component *component,
+		      struct snd_pcm_substream *substream, int cmd);

Looks like this function doesn't exist.

#32 lore raw

PATCH v3 8/10 arm64: tegra: add AHUB components for few Tegra chips

In reply to Sameer Pujar

This patch adds few AHUB modules for Tegra210, Tegra186 and Tegra194. Following modules are common to all above SoCs,
* AHUB added as a child node under ACONNECT
* AHUB includes many HW accelerators and below components are added as its children.
* ADMAIF
* I2S
* DMIC
* DSPK (added for Tegra186 and Tegra194 only, since Tegra210 does not have this module)

---
 arch/arm64/boot/dts/nvidia/tegra186.dtsi | 231 ++++++++++++++++++++++++++++-
 arch/arm64/boot/dts/nvidia/tegra194.dtsi | 239 ++++++++++++++++++++++++++++++-
 arch/arm64/boot/dts/nvidia/tegra210.dtsi | 145 +++++++++++++++++++
 3 files changed, 613 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/nvidia/tegra186.dtsi +230 -1
index 58100fb..8566779 100644
@@ -82,7 +82,7 @@
 		ranges = <0x02900000 0x0 0x02900000 0x200000>;
 		status = "disabled";
 
-		dma-controller@2930000 {
+		adma: dma-controller@2930000 {
 			compatible = "nvidia,tegra186-adma";
 			reg = <0x02930000 0x20000>;
 			interrupt-parent = <&agic>;
@@ -137,6 +137,235 @@
 			clock-names = "clk";
 			status = "disabled";
 		};
+
+		tegra_ahub: ahub@2900800 {
+			compatible = "nvidia,tegra186-ahub";
+			reg = <0x02900800 0x800>;
+			clocks = <&bpmp TEGRA186_CLK_AHUB>;
+			clock-names = "ahub";
+			assigned-clocks = <&bpmp TEGRA186_CLK_AHUB>;
+			assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x02900800 0x02900800 0x11800>;
+			#sound-dai-cells = <1>;
+			status = "disabled";
+
+			tegra_admaif: admaif@290f000 {
+				compatible = "nvidia,tegra186-admaif";
+				reg = <0x0290f000 0x1000>;
+				dmas = <&adma 1>, <&adma 1>,
+				       <&adma 2>, <&adma 2>,
+				       <&adma 3>, <&adma 3>,
+				       <&adma 4>, <&adma 4>,
+				       <&adma 5>, <&adma 5>,
+				       <&adma 6>, <&adma 6>,
+				       <&adma 7>, <&adma 7>,
+				       <&adma 8>, <&adma 8>,
+				       <&adma 9>, <&adma 9>,
+				       <&adma 10>, <&adma 10>,
+				       <&adma 11>, <&adma 11>,
+				       <&adma 12>, <&adma 12>,
+				       <&adma 13>, <&adma 13>,
+				       <&adma 14>, <&adma 14>,
+				       <&adma 15>, <&adma 15>,
+				       <&adma 16>, <&adma 16>,
+				       <&adma 17>, <&adma 17>,
+				       <&adma 18>, <&adma 18>,
+				       <&adma 19>, <&adma 19>,
+				       <&adma 20>, <&adma 20>;
+				dma-names = "rx1", "tx1",
+					    "rx2", "tx2",
+					    "rx3", "tx3",
+					    "rx4", "tx4",
+					    "rx5", "tx5",
+					    "rx6", "tx6",
+					    "rx7", "tx7",
+					    "rx8", "tx8",
+					    "rx9", "tx9",
+					    "rx10", "tx10",
+					    "rx11", "tx11",
+					    "rx12", "tx12",
+					    "rx13", "tx13",
+					    "rx14", "tx14",
+					    "rx15", "tx15",
+					    "rx16", "tx16",
+					    "rx17", "tx17",
+					    "rx18", "tx18",
+					    "rx19", "tx19",
+					    "rx20", "tx20";
+				#sound-dai-cells = <1>;
+				status = "disabled";
+			};
+
+			tegra_i2s1: i2s@2901000 {
+				compatible = "nvidia,tegra186-i2s",
+					     "nvidia,tegra210-i2s";
+				reg = <0x2901000 0x100>;
+				clocks = <&bpmp TEGRA186_CLK_I2S1>,
+					 <&bpmp TEGRA186_CLK_I2S1_SYNC_INPUT>;
+				clock-names = "i2s", "sync_input";
+				assigned-clocks = <&bpmp TEGRA186_CLK_I2S1>;
+				assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+				assigned-clock-rates = <1536000>;
+				#sound-dai-cells = <1>;
+				sound-name-prefix = "I2S1";
+				status = "disabled";
+			};
+
+			tegra_i2s2: i2s@2901100 {
+				compatible = "nvidia,tegra186-i2s",
+					     "nvidia,tegra210-i2s";
+				reg = <0x2901100 0x100>;
+				clocks = <&bpmp TEGRA186_CLK_I2S2>,
+					 <&bpmp TEGRA186_CLK_I2S2_SYNC_INPUT>;
+				clock-names = "i2s", "sync_input";
+				assigned-clocks = <&bpmp TEGRA186_CLK_I2S2>;
+				assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+				assigned-clock-rates = <1536000>;
+				#sound-dai-cells = <1>;
+				sound-name-prefix = "I2S2";
+				status = "disabled";
+			};
+
+			tegra_i2s3: i2s@2901200 {
+				compatible = "nvidia,tegra186-i2s",
+					     "nvidia,tegra210-i2s";
+				reg = <0x2901200 0x100>;
+				clocks = <&bpmp TEGRA186_CLK_I2S3>,
+					 <&bpmp TEGRA186_CLK_I2S3_SYNC_INPUT>;
+				clock-names = "i2s", "sync_input";
+				assigned-clocks = <&bpmp TEGRA186_CLK_I2S3>;
+				assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+				assigned-clock-rates = <1536000>;
+				#sound-dai-cells = <1>;
+				sound-name-prefix = "I2S3";
+				status = "disabled";
+			};
+
+			tegra_i2s4: i2s@2901300 {
+				compatible = "nvidia,tegra186-i2s",
+					     "nvidia,tegra210-i2s";
+				reg = <0x2901300 0x100>;
+				clocks = <&bpmp TEGRA186_CLK_I2S4>,
+					 <&bpmp TEGRA186_CLK_I2S4_SYNC_INPUT>;
+				clock-names = "i2s", "sync_input";
+				assigned-clocks = <&bpmp TEGRA186_CLK_I2S4>;
+				assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+				assigned-clock-rates = <1536000>;
+				#sound-dai-cells = <1>;
+				sound-name-prefix = "I2S4";
+				status = "disabled";
+			};
+
+			tegra_i2s5: i2s@2901400 {
+				compatible = "nvidia,tegra186-i2s",
+					     "nvidia,tegra210-i2s";
+				reg = <0x2901400 0x100>;
+				clocks = <&bpmp TEGRA186_CLK_I2S5>,
+					 <&bpmp TEGRA186_CLK_I2S5_SYNC_INPUT>;
+				clock-names = "i2s", "sync_input";
+				assigned-clocks = <&bpmp TEGRA186_CLK_I2S5>;
+				assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+				assigned-clock-rates = <1536000>;
+				#sound-dai-cells = <1>;
+				sound-name-prefix = "I2S5";
+				status = "disabled";
+			};
+
+			tegra_i2s6: i2s@2901500 {
+				compatible = "nvidia,tegra186-i2s",
+					     "nvidia,tegra210-i2s";
+				reg = <0x2901500 0x100>;
+				clocks = <&bpmp TEGRA186_CLK_I2S6>,
+					 <&bpmp TEGRA186_CLK_I2S6_SYNC_INPUT>;
+				clock-names = "i2s", "sync_input";
+				assigned-clocks = <&bpmp TEGRA186_CLK_I2S6>;
+				assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+				assigned-clock-rates = <1536000>;
+				#sound-dai-cells = <1>;
+				sound-name-prefix = "I2S6";
+				status = "disabled";
+			};
+
+			tegra_dmic1: dmic@2904000 {
+				compatible = "nvidia,tegra210-dmic";
+				reg = <0x2904000 0x100>;
+				clocks = <&bpmp TEGRA186_CLK_DMIC1>;
+				clock-names = "dmic";
+				assigned-clocks = <&bpmp TEGRA186_CLK_DMIC1>;
+				assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+				assigned-clock-rates = <3072000>;
+				#sound-dai-cells = <1>;
+				sound-name-prefix = "DMIC1";
+				status = "disabled";
+			};
+
+			tegra_dmic2: dmic@2904100 {
+				compatible = "nvidia,tegra210-dmic";
+				reg = <0x2904100 0x100>;
+				clocks = <&bpmp TEGRA186_CLK_DMIC2>;
+				clock-names = "dmic";
+				assigned-clocks = <&bpmp TEGRA186_CLK_DMIC2>;
+				assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+				assigned-clock-rates = <3072000>;
+				#sound-dai-cells = <1>;
+				sound-name-prefix = "DMIC2";
+				status = "disabled";
+			};
+
+			tegra_dmic3: dmic@2904200 {
+				compatible = "nvidia,tegra210-dmic";
+				reg = <0x2904200 0x100>;
+				clocks = <&bpmp TEGRA186_CLK_DMIC3>;
+				clock-names = "dmic";
+				assigned-clocks = <&bpmp TEGRA186_CLK_DMIC3>;
+				assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+				assigned-clock-rates = <3072000>;
+				#sound-dai-cells = <1>;
+				sound-name-prefix = "DMIC3";
+				status = "disabled";
+			};
+
+			tegra_dmic4: dmic@2904300 {
+				compatible = "nvidia,tegra210-dmic";
+				reg = <0x2904300 0x100>;
+				clocks = <&bpmp TEGRA186_CLK_DMIC4>;
+				clock-names = "dmic";
+				assigned-clocks = <&bpmp TEGRA186_CLK_DMIC4>;
+				assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+				assigned-clock-rates = <3072000>;
+				#sound-dai-cells = <1>;
+				sound-name-prefix = "DMIC4";
+				status = "disabled";
+			};
+
+			tegra_dspk1: dspk@2905000 {
+				compatible = "nvidia,tegra186-dspk";
+				reg = <0x2905000 0x100>;
+				clocks = <&bpmp TEGRA186_CLK_DSPK1>;
+				clock-names = "dspk";
+				assigned-clocks = <&bpmp TEGRA186_CLK_DSPK1>;
+				assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+				assigned-clock-rates = <12288000>;
+				#sound-dai-cells = <1>;
+				sound-name-prefix = "DSPK1";
+				status = "disabled";
+			};
+
+			tegra_dspk2: dspk@2905100 {
+				compatible = "nvidia,tegra186-dspk";
+				reg = <0x2905100 0x100>;
+				clocks = <&bpmp TEGRA186_CLK_DSPK2>;
+				clock-names = "dspk";
+				assigned-clocks = <&bpmp TEGRA186_CLK_DSPK2>;
+				assigned-clock-parents = <&bpmp TEGRA186_CLK_PLL_A_OUT0>;
+				assigned-clock-rates = <12288000>;
+				#sound-dai-cells = <1>;
+				sound-name-prefix = "DSPK2";
+				status = "disabled";
+			};
+		};
 	};
 
 	memory-controller@2c00000 {
arch/arm64/boot/dts/nvidia/tegra194.dtsi +238 -1

251 lines not on this page · raw message

arch/arm64/boot/dts/nvidia/tegra210.dtsi +145 -0

151 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer Reviewed-by on v3 8/10
#33 lore raw

Re: [PATCH v3 08/10] arm64: tegra: add AHUB components for few Tegra chips

Quoted 11 lines · Sameer Pujar

This patch adds few AHUB modules for Tegra210, Tegra186 and Tegra194. Following modules are common to all above SoCs,
* AHUB added as a child node under ACONNECT
* AHUB includes many HW accelerators and below components are added as its children.
* ADMAIF
* I2S
* DMIC
* DSPK (added for Tegra186 and Tegra194 only, since Tegra210 does not have this module)

Quoted 6 lines
---
 arch/arm64/boot/dts/nvidia/tegra186.dtsi | 231 ++++++++++++++++++++++++++++-
 arch/arm64/boot/dts/nvidia/tegra194.dtsi | 239 ++++++++++++++++++++++++++++++-
 arch/arm64/boot/dts/nvidia/tegra210.dtsi | 145 +++++++++++++++++++
 3 files changed, 613 insertions(+), 2 deletions(-)

Thanks!

Cheers
Jon

Signature · 1 line
nvpublic
#34 lore raw

PATCH v3 9/10 arm64: tegra: enable AHUB modules for few Tegra chips

In reply to Sameer Pujar

This patch enables AHUB, ADMAIF modules for following Tegra platforms. Along with this specific instances of I/O modules are enabled as per the board design.

* Jetson TX1
- I2S1, I2S2, I2S3, I2S4 and I2S5
- DMIC1, DMIC2 and DMIC3

* Jetson TX2
- I2S1, I2S2, I2S3, I2S4, I2S5 and I2S6
- DMIC1, DMIC2 and DMIC3
- DSPK2

* Jetson AGX Xavier
- I2S1, I2S2, I2S4 and I2S6
- DMIC2 and DMIC3
- DSPK1

---
 arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 48 ++++++++++++++++++++++
 arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts | 36 ++++++++++++++++
 arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 40 ++++++++++++++++++
 3 files changed, 124 insertions(+)
arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts +48 -0
index d7628f5..2f120fb 100644
@@ -20,6 +20,54 @@
 		interrupt-controller@2a40000 {
 			status = "okay";
 		};
+
+		ahub@2900800 {
+			status = "okay";
+
+			admaif@290f000 {
+				status = "okay";
+			};
+
+			i2s@2901000 {
+				status = "okay";
+			};
+
+			i2s@2901100 {
+				status = "okay";
+			};
+
+			i2s@2901200 {
+				status = "okay";
+			};
+
+			i2s@2901300 {
+				status = "okay";
+			};
+
+			i2s@2901400 {
+				status = "okay";
+			};
+
+			i2s@2901500 {
+				status = "okay";
+			};
+
+			dmic@2904000 {
+				status = "okay";
+			};
+
+			dmic@2904100 {
+				status = "okay";
+			};
+
+			dmic@2904200 {
+				status = "okay";
+			};
+
+			dspk@2905100 {
+				status = "okay";
+			};
+		};
 	};
 
 	i2c@3160000 {
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +36 -0
index f9f874d..a0b2931 100644
@@ -21,6 +21,42 @@
 			interrupt-controller@2a40000 {
 				status = "okay";
 			};
+
+			ahub@2900800 {
+				status = "okay";
+
+				admaif@290f000 {
+					status = "okay";
+				};
+
+				i2s@2901000 {
+					status = "okay";
+				};
+
+				i2s@2901100 {
+					status = "okay";
+				};
+
+				i2s@2901300 {
+					status = "okay";
+				};
+
+				i2s@2901500 {
+					status = "okay";
+				};
+
+				dmic@2904100 {
+					status = "okay";
+				};
+
+				dmic@2904200 {
+					status = "okay";
+				};
+
+				dspk@2905000 {
+					status = "okay";
+				};
+			};
 		};
 
 		ddc: i2c@31c0000 {
arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts +40 -0
index a3cafe3..c8d2c21 100644
@@ -123,5 +123,45 @@
 		agic@702f9000 {
 			status = "okay";
 		};
+
+		ahub@702d0800 {
+			status = "okay";
+
+			admaif@702d0000 {
+				status = "okay";
+			};
+
+			i2s@702d1000 {
+				status = "okay";
+			};
+
+			i2s@702d1100 {
+				status = "okay";
+			};
+
+			i2s@702d1200 {
+				status = "okay";
+			};
+
+			i2s@702d1300 {
+				status = "okay";
+			};
+
+			i2s@702d1400 {
+				status = "okay";
+			};
+
+			dmic@702d4000 {
+				status = "okay";
+			};
+
+			dmic@702d4100 {
+				status = "okay";
+			};
+
+			dmic@702d4200 {
+				status = "okay";
+			};
+		};
 	};
 };
Signature · 1 line
2.7.4
maintainer Reviewed-by on v3 9/10
#35 lore raw

Re: [PATCH v3 09/10] arm64: tegra: enable AHUB modules for few Tegra chips

Quoted 18 lines · Sameer Pujar

This patch enables AHUB, ADMAIF modules for following Tegra platforms. Along with this specific instances of I/O modules are enabled as per the board design.

* Jetson TX1
- I2S1, I2S2, I2S3, I2S4 and I2S5
- DMIC1, DMIC2 and DMIC3

* Jetson TX2
- I2S1, I2S2, I2S3, I2S4, I2S5 and I2S6
- DMIC1, DMIC2 and DMIC3
- DSPK2

* Jetson AGX Xavier
- I2S1, I2S2, I2S4 and I2S6
- DMIC2 and DMIC3
- DSPK1

Quoted 6 lines
---
 arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 48 ++++++++++++++++++++++
 arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts | 36 ++++++++++++++++
 arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 40 ++++++++++++++++++
 3 files changed, 124 insertions(+)

Thanks!

Cheers
Jon

Signature · 1 line
nvpublic
#36 lore raw

PATCH v3 10/10 arm64: defconfig: enable AHUB components for Tegra210 and later

In reply to Sameer Pujar

This patch enables following configs:
+CONFIG_TEGRA_ACONNECT=m
+CONFIG_SND_SOC_TEGRA=m
+CONFIG_SND_SOC_TEGRA210_AHUB=m
+CONFIG_SND_SOC_TEGRA210_DMIC=m
+CONFIG_SND_SOC_TEGRA210_I2S=m
+CONFIG_SND_SOC_TEGRA186_DSPK=m
+CONFIG_SND_SOC_TEGRA210_ADMAIF=m

This patch helps to register AHUB and its clients (I2S, DMIC, DSPK, ADMAIF) with ASoC core. Since AHUB is child of ACONNECT, config TEGRA_ACONNECT is enabled as well.

---
 arch/arm64/configs/defconfig | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/configs/defconfig +7 -0
index c8801be..784ca4f 100644
@@ -207,6 +207,7 @@ CONFIG_FW_LOADER_USER_HELPER=y
 CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
 CONFIG_HISILICON_LPC=y
 CONFIG_SIMPLE_PM_BUS=y
+CONFIG_TEGRA_ACONNECT=m
 CONFIG_MTD=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_RAW_NAND=y
@@ -590,6 +591,12 @@ CONFIG_SND_SOC_RK3399_GRU_SOUND=m
 CONFIG_SND_SOC_SAMSUNG=y
 CONFIG_SND_SOC_RCAR=m
 CONFIG_SND_SUN4I_SPDIF=m
+CONFIG_SND_SOC_TEGRA=m
+CONFIG_SND_SOC_TEGRA210_AHUB=m
+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_AK4613=m
 CONFIG_SND_SOC_ES7134=m
 CONFIG_SND_SOC_ES7241=m
Signature · 1 line
2.7.4
maintainer Reviewed-by on v3 10/10
#37 lore raw

Re: [PATCH v3 10/10] arm64: defconfig: enable AHUB components for Tegra210 and later

Quoted 33 lines · Sameer Pujar

This patch enables following configs:
+CONFIG_TEGRA_ACONNECT=m
+CONFIG_SND_SOC_TEGRA=m
+CONFIG_SND_SOC_TEGRA210_AHUB=m
+CONFIG_SND_SOC_TEGRA210_DMIC=m
+CONFIG_SND_SOC_TEGRA210_I2S=m
+CONFIG_SND_SOC_TEGRA186_DSPK=m
+CONFIG_SND_SOC_TEGRA210_ADMAIF=m

This patch helps to register AHUB and its clients (I2S, DMIC, DSPK, ADMAIF) with ASoC core. Since AHUB is child of ACONNECT, config TEGRA_ACONNECT is enabled as well.

---
 arch/arm64/configs/defconfig | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/configs/defconfig +1 -0
index c8801be..784ca4f 100644
@@ -207,6 +207,7 @@ CONFIG_FW_LOADER_USER_HELPER=y
 CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
 CONFIG_HISILICON_LPC=y
 CONFIG_SIMPLE_PM_BUS=y
+CONFIG_TEGRA_ACONNECT=m
 CONFIG_MTD=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_RAW_NAND=y
@@ -590,6 +591,12 @@ CONFIG_SND_SOC_RK3399_GRU_SOUND=m
 CONFIG_SND_SOC_SAMSUNG=y
 CONFIG_SND_SOC_RCAR=m

arch/arm64/configs/defconfig CONFIG_SND_SOC_RK3399_GRU_SOUND=m · line 602

Quoted 10 lines
arch/arm64/configs/defconfig +6 -0
 CONFIG_SND_SUN4I_SPDIF=m
+CONFIG_SND_SOC_TEGRA=m
+CONFIG_SND_SOC_TEGRA210_AHUB=m
+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_AK4613=m
 CONFIG_SND_SOC_ES7134=m
 CONFIG_SND_SOC_ES7241=m

Thanks!

Cheers
Jon

Signature · 1 line
nvpublic
Reviewed-by on v3 10/10
#38 lore raw

Re: [PATCH v3 10/10] arm64: defconfig: enable AHUB components for Tegra210 and later

In reply to Sameer Pujar

20.02.2020 09:34, Sameer Pujar пишет:

Quoted 8 lines

This patch enables following configs:
+CONFIG_TEGRA_ACONNECT=m
+CONFIG_SND_SOC_TEGRA=m
+CONFIG_SND_SOC_TEGRA210_AHUB=m
+CONFIG_SND_SOC_TEGRA210_DMIC=m
+CONFIG_SND_SOC_TEGRA210_I2S=m
+CONFIG_SND_SOC_TEGRA186_DSPK=m
+CONFIG_SND_SOC_TEGRA210_ADMAIF=m

There is no needed to duplicate contents of the patch in the commit's description, otherwise:

Quoted 35 lines

This patch helps to register AHUB and its clients (I2S, DMIC, DSPK, ADMAIF) with ASoC core. Since AHUB is child of ACONNECT, config TEGRA_ACONNECT is enabled as well.

---
 arch/arm64/configs/defconfig | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/configs/defconfig +7 -0
index c8801be..784ca4f 100644
@@ -207,6 +207,7 @@ CONFIG_FW_LOADER_USER_HELPER=y
 CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
 CONFIG_HISILICON_LPC=y
 CONFIG_SIMPLE_PM_BUS=y
+CONFIG_TEGRA_ACONNECT=m
 CONFIG_MTD=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_RAW_NAND=y
@@ -590,6 +591,12 @@ CONFIG_SND_SOC_RK3399_GRU_SOUND=m
 CONFIG_SND_SOC_SAMSUNG=y
 CONFIG_SND_SOC_RCAR=m
 CONFIG_SND_SUN4I_SPDIF=m
+CONFIG_SND_SOC_TEGRA=m
+CONFIG_SND_SOC_TEGRA210_AHUB=m
+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_AK4613=m
 CONFIG_SND_SOC_ES7134=m
 CONFIG_SND_SOC_ES7241=m