add ASoC components for AHUB
Subsystems (4)
v2 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
=========
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 (9):
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
.../bindings/sound/nvidia,tegra186-dspk.yaml | 105 +++ .../bindings/sound/nvidia,tegra210-admaif.yaml | 165 ++++ .../bindings/sound/nvidia,tegra210-ahub.yaml | 130 +++ .../bindings/sound/nvidia,tegra210-dmic.yaml | 105 +++ .../bindings/sound/nvidia,tegra210-i2s.yaml | 112 +++ 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 ++++ sound/soc/tegra/Kconfig | 56 ++ sound/soc/tegra/Makefile | 12 + sound/soc/tegra/tegra186_dspk.c | 512 +++++++++++ sound/soc/tegra/tegra186_dspk.h | 73 ++ sound/soc/tegra/tegra210_admaif.c | 886 +++++++++++++++++++ sound/soc/tegra/tegra210_admaif.h | 164 ++++ sound/soc/tegra/tegra210_ahub.c | 653 ++++++++++++++ sound/soc/tegra/tegra210_ahub.h | 125 +++ sound/soc/tegra/tegra210_dmic.c | 517 ++++++++++++ sound/soc/tegra/tegra210_dmic.h | 85 ++ sound/soc/tegra/tegra210_i2s.c | 939 +++++++++++++++++++++ sound/soc/tegra/tegra210_i2s.h | 132 +++ sound/soc/tegra/tegra_cif.c | 34 + sound/soc/tegra/tegra_cif.h | 47 ++ sound/soc/tegra/tegra_pcm.c | 222 ++++- sound/soc/tegra/tegra_pcm.h | 23 +- 27 files changed, 5832 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.c create mode 100644 sound/soc/tegra/tegra_cif.h
Signature · 1 line
2.7.4
PATCH v2 1/9 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 | 105 +++++++++++++ .../bindings/sound/nvidia,tegra210-admaif.yaml | 165 +++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-ahub.yaml | 130 ++++++++++++++++ .../bindings/sound/nvidia,tegra210-dmic.yaml | 105 +++++++++++++ .../bindings/sound/nvidia,tegra210-i2s.yaml | 112 ++++++++++++++ 5 files changed, 617 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 +105 -0
@@ -0,0 +1,105 @@ +# SPDX-License-Identifier: (GPL-2.0) +%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: + compatible: + oneOf: + - items: + const: nvidia,tegra186-dspk + - items: + - enum: + - nvidia,tegra194-dspk + - enum: + - nvidia,tegra186-dspk + + reg: + description: offset and length of the register set for the device. + maxItems: 1 + + clocks: + description: must contain an entry for each entry in clock-names. + See ../clocks/clocks-bindings.txt for details. + minItems: 1 + items: + - description: Module clock + + clock-names: + description: must contain clock names for each corresponding entry in clocks. + See ../clocks/clocks-bindings.txt for details. + minItems: 1 + items: + - const: dspk + + assigned-clocks: + description: list of input clocks and dividers for the audio system. + See ../clocks/clock-bindings.txt for details. + minItems: 1 + items: + - description: Module clock + + assigned-clock-parents: + description: parent clock for each entry in assigned-clocks + See ../clocks/clock-bindings.txt for details. + minItems: 1 + items: + - description: Parent for module clock + + assigned-clock-rates: + description: clock rate for each entry in assigned-clocks + See ../clocks/clock-bindings.txt for details. + items: + - description: initial module clock rate + + "#sound-dai-cells": + const: 1 + + sound-name-prefix: + $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" + +examples: + - | + #include<dt-bindings/clock/tegra186-clock.h> + + 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"; + }; + +...
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml new file +165 -0
165 lines not on this page · raw message
Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yaml new file +130 -0
130 lines not on this page · raw message
Documentation/devicetree/bindings/sound/nvidia,tegra210-dmic.yaml new file +105 -0
105 lines not on this page · raw message
Documentation/devicetree/bindings/sound/nvidia,tegra210-i2s.yaml new file +112 -0
112 lines not on this page · raw message
Signature · 1 line
2.7.4
Re: [PATCH v2 1/9] dt-bindings: sound: tegra: add DT binding for AHUB
30.01.2020 13:33, Sameer Pujar пишет:
...
Documentation/devicetree/bindings/sound/nvidia,tegra210-i2s.yaml line 29
Quoted 11 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-i2s.yaml new file +11
-0+properties: + compatible: + oneOf: + - items: + const: nvidia,tegra210-i2s + - items: + - enum: + - nvidia,tegra194-i2s + - nvidia,tegra186-i2s + - enum: + - nvidia,tegra210-i2s
Couldn't this be something like this:
properties:
compatible:
- enum:
- nvidia,tegra210-i2s
- nvidia,tegra186-i2s
- nvidia,tegra194-i2s
Re: [PATCH v2 1/9] dt-bindings: sound: tegra: add DT binding for AHUB
Quoted 16 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...Documentation/devicetree/bindings/sound/nvidia,tegra210-i2s.yaml line 29
Quoted 11 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-i2s.yaml new file +11
-0+properties: + compatible: + oneOf: + - items: + const: nvidia,tegra210-i2s + - items: + - enum: + - nvidia,tegra194-i2s + - nvidia,tegra186-i2s + - enum: + - nvidia,tegra210-i2s
Quoted 8 lines
Couldn't this be something like this:
properties:
compatible:
- enum:
- nvidia,tegra210-i2s
- nvidia,tegra186-i2s
- nvidia,tegra194-i2s
I used that way because,
For Tegra210: compatible = "nvidia,tegra210-i2s";
For Tegra186: compatible = "nvidia,tegra186-i2s", "nvidia,tegra210-i2s"; (future proof) For Tegra194: compatible = "nvidia,tegra194-i2s", "nvidia,tegra210-i2s"; (future proof)
Currently driver uses "nvidia,tegra210-i2s" alone.
YAML binding check fails otherwise as it does not let me have future proof bindings.
Rob Herring
maintainerRe: [PATCH v2 1/9] dt-bindings: sound: tegra: add DT binding for AHUB
In reply to Sameer PujarQuoted 30 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
* DSPKSigned-off-by Sameer Pujar <[email protected]>--- .../bindings/sound/nvidia,tegra186-dspk.yaml | 105 +++++++++++++ .../bindings/sound/nvidia,tegra210-admaif.yaml | 165 +++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-ahub.yaml | 130 ++++++++++++++++ .../bindings/sound/nvidia,tegra210-dmic.yaml | 105 +++++++++++++ .../bindings/sound/nvidia,tegra210-i2s.yaml | 112 ++++++++++++++ 5 files changed, 617 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.yamlDocumentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +0
-0
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 1
Quoted 1 line
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +1
-0@@ -0,0 +1,105 @@ +# SPDX-License-Identifier: (GPL-2.0)
Dual license new bindings:
(GPL-2.0-only OR BSD-2-Clause)
Quoted 12 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +12
-0+%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
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 23
Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +10
-0+ output via Delta Sigma Modulation (DSM). + +maintainers: + - Jon Hunter <[email protected]> + - Sameer Pujar <[email protected]> + +properties: + compatible: + oneOf: + - items:
Drop 'items' for a single entry.
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 29
Quoted 6 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +6
-0+ const: nvidia,tegra186-dspk + - items: + - enum: + - nvidia,tegra194-dspk + - enum: + - nvidia,tegra186-dspk
This can be a 'const'
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 32
Quoted 3 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +3
-0+ + reg: + description: offset and length of the register set for the device.
That's every 'reg'. Drop.
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 38
Quoted 6 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +6
-0+ maxItems: 1 + + clocks: + description: must contain an entry for each entry in clock-names. + See ../clocks/clocks-bindings.txt for details. + minItems: 1
Drop description and minItems. minItems is implied by the length of 'items'.
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 45
Quoted 7 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +7
-0+ items: + - description: Module clock + + clock-names: + description: must contain clock names for each corresponding entry in clocks. + See ../clocks/clocks-bindings.txt for details. + minItems: 1
ditto
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 52
Quoted 7 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +7
-0+ items: + - const: dspk + + assigned-clocks: + description: list of input clocks and dividers for the audio system. + See ../clocks/clock-bindings.txt for details. + minItems: 1
ditto
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 59
Quoted 7 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +7
-0+ items: + - description: Module clock + + assigned-clock-parents: + description: parent clock for each entry in assigned-clocks + See ../clocks/clock-bindings.txt for details. + minItems: 1
ditto
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 65
Quoted 6 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +6
-0+ items: + - description: Parent for module clock + + assigned-clock-rates: + description: clock rate for each entry in assigned-clocks + See ../clocks/clock-bindings.txt for details.
ditto
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 77
Quoted 12 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +12
-0+ items: + - description: initial module clock rate + + "#sound-dai-cells": + const: 1 + + sound-name-prefix: + $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
Sounds like a constraint.
Quoted 50 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +28
-0+ available instances on a Tegra SoC. + +required: + - compatible + - reg + - clocks + - clock-names + - assigned-clocks + - assigned-clock-parents + - "#sound-dai-cells" + +examples: + - | + #include<dt-bindings/clock/tegra186-clock.h> + + 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"; + }; + +...Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml new file +16
-0@@ -0,0 +1,165 @@ +# SPAT-License-Identifier: (GPL-2.0) +%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:
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml line 26
Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml new file +10
-0+ - Jon Hunter <[email protected]> + - Sameer Pujar <[email protected]> + +properties: + compatible: + oneOf: + - items: + const: nvidia,tegra210-admaif + - items: + const: nvidia,tegra186-admaif
These 2 can be a single enum.
Quoted 16 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml new file +16
-0+ - items: + - enum: + - nvidia,tegra194-admaif + - enum: + - nvidia,tegra186-admaif + + reg: + maxItems: 1 + + dmas: true + + dma-names: true + + "#sound-dai-cells": + const: 1 +
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml line 52
Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml new file +10
-0+if: + properties: + compatible: + contains: + const: nvidia,tegra210-admaif + +then: + properties: + dmas: + $ref: /schemas/types.yaml#/definitions/phandle-array
Drop. Common properties already have a type.
Plus this is wrong. A '$ref' means all other keywords are ignored (until we move to draft8).
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml line 58
Quoted 6 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml new file +6
-0+ description: + Two or more DMA channel specifiers, equally divided for Tx and Rx. + minItems: 2 + maxItems: 20 + dma-names: + $ref: /schemas/types.yaml#/definitions/string-array
drop
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml line 62
Quoted 4 lines
Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yaml new file +4
-0+ description: + There must be at least one channel named "tx1" for transmit and "rx1" + for receive. If more channels need to be specified then "tx1", + "tx2" ... "tx10" can be used. Similarly for Rx channels as well.
Sounds like constraints.
Stopping there. Similar issues on the rest...
Re: [PATCH v2 1/9] dt-bindings: sound: tegra: add DT binding for AHUB
Quoted 28 lines · Rob Herring
External email: Use caution opening links or attachments
Quoted 24 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
* DSPKSigned-off-by Sameer Pujar <[email protected]>--- .../bindings/sound/nvidia,tegra186-dspk.yaml | 105 +++++++++++++ .../bindings/sound/nvidia,tegra210-admaif.yaml | 165 +++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-ahub.yaml | 130 ++++++++++++++++ .../bindings/sound/nvidia,tegra210-dmic.yaml | 105 +++++++++++++ .../bindings/sound/nvidia,tegra210-i2s.yaml | 112 ++++++++++++++ 5 files changed, 617 insertions(+)create mode 100644
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yamlcreate mode 100644Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yamlcreate mode 100644Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yamlcreate mode 100644Documentation/devicetree/bindings/sound/nvidia,tegra210-dmic.yamlcreate mode 100644Documentation/devicetree/bindings/sound/nvidia,tegra210-i2s.yaml
Quoted 7 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 1
Quoted 7 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +1
-0@@ -0,0 +1,105 @@ +# SPDX-License-Identifier: (GPL-2.0)
. . .
Quoted 5 lines
Quoted 5 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +5
-0+ items: + - description: initial module clock rate + + "#sound-dai-cells": + const: 1
Quoted 8 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 77
Quoted 7 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +7
-0+ + sound-name-prefix: + $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 maximumSounds like a constraint.
Is there a better way to convey the recommended strings above?
All the other comments I will fix in next revision. Thanks. . . .
Rob Herring
maintainerRe: [PATCH v2 1/9] dt-bindings: sound: tegra: add DT binding for AHUB
Quoted 54 lines · Sameer Pujar
Quoted 28 lines · Rob Herring
External email: Use caution opening links or attachments
Quoted 24 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
* DSPKSigned-off-by Sameer Pujar <[email protected]>--- .../bindings/sound/nvidia,tegra186-dspk.yaml | 105 +++++++++++++ .../bindings/sound/nvidia,tegra210-admaif.yaml | 165 +++++++++++++++++++++ .../bindings/sound/nvidia,tegra210-ahub.yaml | 130 ++++++++++++++++ .../bindings/sound/nvidia,tegra210-dmic.yaml | 105 +++++++++++++ .../bindings/sound/nvidia,tegra210-i2s.yaml | 112 ++++++++++++++ 5 files changed, 617 insertions(+)create mode 100644
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yamlcreate mode 100644Documentation/devicetree/bindings/sound/nvidia,tegra210-admaif.yamlcreate mode 100644Documentation/devicetree/bindings/sound/nvidia,tegra210-ahub.yamlcreate mode 100644Documentation/devicetree/bindings/sound/nvidia,tegra210-dmic.yamlcreate mode 100644Documentation/devicetree/bindings/sound/nvidia,tegra210-i2s.yamlQuoted 7 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 1
Quoted 7 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +1
-0@@ -0,0 +1,105 @@ +# SPDX-License-Identifier: (GPL-2.0). . .
Quoted 5 lines
Quoted 5 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +5
-0+ items: + - description: initial module clock rate + + "#sound-dai-cells": + const: 1Quoted 8 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml line 77
Quoted 7 lines
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml new file +7
-0+ + sound-name-prefix: + $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 maximumSounds like a constraint.
Quoted 1 line
Is there a better way to convey the recommended strings above?
pattern: '^DSPK[1-9]$'
Adjusting the number range regex as you need.
(And $ref will need to be under an 'allOf')
Rob
PATCH v2 2/9 ASoC: tegra: add support for CIF programming
In reply to Sameer PujarAudio 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 a helper 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/Makefile | 2 ++ sound/soc/tegra/tegra_cif.c | 34 ++++++++++++++++++++++++++++++++ sound/soc/tegra/tegra_cif.h | 47 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 sound/soc/tegra/tegra_cif.c create mode 100644 sound/soc/tegra/tegra_cif.h
sound/soc/tegra/Makefile +2 -0
@@ -8,9 +8,11 @@ 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-tegra-cif-objs := tegra_cif.o obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-pcm.o obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-utils.o +obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-cif.o obj-$(CONFIG_SND_SOC_TEGRA20_AC97) += snd-soc-tegra20-ac97.o obj-$(CONFIG_SND_SOC_TEGRA20_DAS) += snd-soc-tegra20-das.o obj-$(CONFIG_SND_SOC_TEGRA20_I2S) += snd-soc-tegra20-i2s.o
sound/soc/tegra/tegra_cif.c new file +34 -0
@@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* +* tegra_cif.c - Tegra Audio CIF Programming for AHUB modules +* +* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. +* +*/ + +#include <linux/module.h> +#include <linux/regmap.h> +#include "tegra_cif.h" + +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); +} +EXPORT_SYMBOL_GPL (tegra_set_cif); + +MODULE_DESCRIPTION ("Tegra Audio Client Interface (ACIF) driver" ); +MODULE_LICENSE ("GPL v2" );
sound/soc/tegra/tegra_cif.h new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
2.7.4
Re: [PATCH v2 2/9] ASoC: tegra: add support for CIF programming
30.01.2020 13:33, Sameer Pujar пишет:
...
Quoted 13 lines
sound/soc/tegra/tegra_cif.c new file +13
-0+#include <linux/module.h> +#include <linux/regmap.h> +#include "tegra_cif.h" + +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) |
sound/soc/tegra/tegra_cif.c line 31
Quoted 10 lines
sound/soc/tegra/tegra_cif.c new file +10
-0+ (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); +} +EXPORT_SYMBOL_GPL (tegra_set_cif);
Are you going to add more stuff into this source file later on?
If not, then it's too much to have a separate driver module just for a single tiny function, you should move it into the header file (make it inline).
Re: [PATCH v2 2/9] ASoC: tegra: add support for CIF programming
Quoted 21 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 16 lines
sound/soc/tegra/tegra_cif.c new file +16
-0+#include <linux/module.h> +#include <linux/regmap.h> +#include "tegra_cif.h" + +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) |
Quoted 8 lines
sound/soc/tegra/tegra_cif.c line 31
Quoted 7 lines
sound/soc/tegra/tegra_cif.c new file +7
-0+ (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); +} +EXPORT_SYMBOL_GPL (tegra_set_cif);Are you going to add more stuff into this source file later on?
Yes I plan to add Tegra30 and Tegra124 CIF functions in this. Anything related to CIF can be moved here.
Quoted 4 lines
If not, then it's too much to have a separate driver module just for a single tiny function, you should move it into the header file (make it inline).
Re: [PATCH v2 2/9] ASoC: tegra: add support for CIF programming
06.02.2020 14:56, Sameer Pujar пишет:
Quoted 34 lines · Dmitry Osipenko
Quoted 22 lines
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 17 lines
sound/soc/tegra/tegra_cif.c new file +12
-0+#include <linux/module.h> +#include <linux/regmap.h> +#include "tegra_cif.h" + +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) |Quoted 8 lines
sound/soc/tegra/tegra_cif.c line 31
Quoted 7 lines
+ (
conf->replicate<<TEGRA_ACIF_CTRL_REPLICATE_SHIFT) | + (conf->truncate<<TEGRA_ACIF_CTRL_TRUNCATE_SHIFT) | + (conf->mono_conv<<TEGRA_ACIF_CTRL_MONO_CONV_SHIFT);sound/soc/tegra/tegra_cif.c new file +4
-0+ + regmap_update_bits(regmap, reg, TEGRA_ACIF_UPDATE_MASK, value); +} +EXPORT_SYMBOL_GPL (tegra_set_cif);Are you going to add more stuff into this source file later on?
Quoted 7 lines
Yes I plan to add Tegra30 and Tegra124 CIF functions in this. Anything related to CIF can be moved here.
Quoted 4 lines
If not, then it's too much to have a separate driver module just for a single tiny function, you should move it into the header file (make it inline).
You should consider whether it's worth to move anything else to this module first, because if the functions are not reusable by the drivers, then the movement won't bring any benefits and final result could be negative in regards to the code's organization.
I suggest to start clean and easy, without the driver module. You will be able to factor code into module later on, once there will a real need to do that.
Re: [PATCH v2 2/9] ASoC: tegra: add support for CIF programming
Quoted 41 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
06.02.2020 14:56, Sameer Pujar пишет:
Quoted 32 lines · Dmitry Osipenko
Quoted 22 lines
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 17 lines
sound/soc/tegra/tegra_cif.c new file +12
-0+#include <linux/module.h> +#include <linux/regmap.h> +#include "tegra_cif.h" + +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) |sound/soc/tegra/tegra_cif.c new file +4
-0+ (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) |Quoted 8 lines
sound/soc/tegra/tegra_cif.c line 31
Quoted 7 lines
sound/soc/tegra/tegra_cif.c new file +7
-0+ (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); +} +EXPORT_SYMBOL_GPL (tegra_set_cif);Are you going to add more stuff into this source file later on?
Quoted 5 lines
Yes I plan to add Tegra30 and Tegra124 CIF functions in this. Anything related to CIF can be moved here.
Quoted 3 lines
If not, then it's too much to have a separate driver module just for a single tiny function, you should move it into the header file (make it inline).
Quoted 8 lines
You should consider whether it's worth to move anything else to this module first, because if the functions are not reusable by the drivers, then the movement won't bring any benefits and final result could be negative in regards to the code's organization.
I suggest to start clean and easy, without the driver module. You will be able to factor code into module later on, once there will a real need to do that.
Tegra124 can reuse above CIF function. Tegra30 will continue to use the same function. For consistency all CIF related helpers can be grouped at one place. But this is for later. I will start with inline function.
PATCH v2 3/9 ASoC: tegra: add Tegra210 based DMIC driver
In reply to Sameer PujarThe 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 | 517 ++++++++++++++++++++++++++++++++++++++++ sound/soc/tegra/tegra210_dmic.h | 85 +++++++ 4 files changed, 615 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
@@ -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
@@ -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-tegra-cif-objs := tegra_cif.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
@@ -19,6 +20,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 +517 -0
517 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
Re: [PATCH v2 3/9] ASoC: tegra: add Tegra210 based DMIC driver
30.01.2020 13:33, Sameer Pujar пишет:
...
Quoted 11 lines
sound/soc/tegra/tegra210_dmic.c new file +11
-0+static const struct reg_default tegra210_dmic_reg_defaults[] = { + {TEGRA210_DMIC_TX_INT_MASK ,0x00000001 }, + {TEGRA210_DMIC_TX_CIF_CTRL ,0x00007700 }, + {TEGRA210_DMIC_CG ,0x1 }, + {TEGRA210_DMIC_CTRL ,0x00000301 }, +/* Below enables all filters - DCR, LP and SC */ + {TEGRA210_DMIC_DBG_CTRL ,0xe }, +/* Below as per latest POR value */ + {TEGRA210_DMIC_DCR_BIQUAD_0_COEF_4 ,0x0 }, +/* LP filter is configured for pass through and used to apply gain */ + {TEGRA210_DMIC_LP_BIQUAD_0_COEF_0 ,0x00800000 },
sound/soc/tegra/tegra210_dmic.c line 41
Quoted 10 lines
sound/soc/tegra/tegra210_dmic.c new file +10
-0+ { TEGRA210_DMIC_LP_BIQUAD_0_COEF_1, 0x0}, + { TEGRA210_DMIC_LP_BIQUAD_0_COEF_2, 0x0}, + { TEGRA210_DMIC_LP_BIQUAD_0_COEF_3, 0x0}, + { TEGRA210_DMIC_LP_BIQUAD_0_COEF_4, 0x0}, + { TEGRA210_DMIC_LP_BIQUAD_1_COEF_0, 0x00800000}, + { TEGRA210_DMIC_LP_BIQUAD_1_COEF_1, 0x0}, + { TEGRA210_DMIC_LP_BIQUAD_1_COEF_2, 0x0}, + { TEGRA210_DMIC_LP_BIQUAD_1_COEF_3, 0x0}, + { TEGRA210_DMIC_LP_BIQUAD_1_COEF_4, 0x0}, +};
I'd add a space on the right side of }, for consistency with the left.
Re: [PATCH v2 3/9] ASoC: tegra: add Tegra210 based DMIC driver
Quoted 19 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 14 lines
sound/soc/tegra/tegra210_dmic.c new file +14
-0+static const struct reg_default tegra210_dmic_reg_defaults[] = { + {TEGRA210_DMIC_TX_INT_MASK ,0x00000001 }, + {TEGRA210_DMIC_TX_CIF_CTRL ,0x00007700 }, + {TEGRA210_DMIC_CG ,0x1 }, + {TEGRA210_DMIC_CTRL ,0x00000301 }, +/* Below enables all filters - DCR, LP and SC */ + {TEGRA210_DMIC_DBG_CTRL ,0xe }, +/* Below as per latest POR value */ + {TEGRA210_DMIC_DCR_BIQUAD_0_COEF_4 ,0x0 }, +/* LP filter is configured for pass through and used to apply gain */ + {TEGRA210_DMIC_LP_BIQUAD_0_COEF_0 ,0x00800000 }, + {TEGRA210_DMIC_LP_BIQUAD_0_COEF_1 ,0x0 }, + {TEGRA210_DMIC_LP_BIQUAD_0_COEF_2 ,0x0 }, + {TEGRA210_DMIC_LP_BIQUAD_0_COEF_3 ,0x0 },
Quoted 8 lines
sound/soc/tegra/tegra210_dmic.c line 41
Quoted 7 lines
sound/soc/tegra/tegra210_dmic.c new file +7
-0+ { TEGRA210_DMIC_LP_BIQUAD_0_COEF_4, 0x0}, + { TEGRA210_DMIC_LP_BIQUAD_1_COEF_0, 0x00800000}, + { TEGRA210_DMIC_LP_BIQUAD_1_COEF_1, 0x0}, + { TEGRA210_DMIC_LP_BIQUAD_1_COEF_2, 0x0}, + { TEGRA210_DMIC_LP_BIQUAD_1_COEF_3, 0x0}, + { TEGRA210_DMIC_LP_BIQUAD_1_COEF_4, 0x0}, +};I'd add a space on the right side of
}, for consistency with the left.
Do you mean like this?
{ TEGRA210_DMIC_TX_INT_MASK, 0x00000001 },
{ TEGRA210_DMIC_TX_CIF_CTRL, 0x00007700 },
. . .
Re: [PATCH v2 3/9] ASoC: tegra: add Tegra210 based DMIC driver
07.02.2020 14:06, Sameer Pujar пишет:
Quoted 32 lines · Dmitry Osipenko
Quoted 20 lines
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 15 lines
+static const struct
reg_defaulttegra210_dmic_reg_defaults[] = { + {TEGRA210_DMIC_TX_INT_MASK,0x00000001},
+ {TEGRA210_DMIC_TX_CIF_CTRL,0x00007700},
+ {TEGRA210_DMIC_CG,0x1},
+ {TEGRA210_DMIC_CTRL,0x00000301},
+ /* Below enables all filters - DCR, LP and SC */
+ {TEGRA210_DMIC_DBG_CTRL,0xe},
+ /* Below as per latest POR value */
+ {TEGRA210_DMIC_DCR_BIQUAD_0_COEF_4,0x0},
+ /* LP filter is configured for pass through and used to apply gain */
+ {TEGRA210_DMIC_LP_BIQUAD_0_COEF_0,0x00800000},
+ {TEGRA210_DMIC_LP_BIQUAD_0_COEF_1,0x0},
+ {TEGRA210_DMIC_LP_BIQUAD_0_COEF_2,0x0},
+ {TEGRA210_DMIC_LP_BIQUAD_0_COEF_3,0x0},Quoted 8 lines
Quoted 7 lines
+ {
TEGRA210_DMIC_LP_BIQUAD_0_COEF_4,0x0}, + {TEGRA210_DMIC_LP_BIQUAD_1_COEF_0,0x00800000}, + {TEGRA210_DMIC_LP_BIQUAD_1_COEF_1,0x0}, + {TEGRA210_DMIC_LP_BIQUAD_1_COEF_2,0x0}, + {TEGRA210_DMIC_LP_BIQUAD_1_COEF_3,0x0}, + {TEGRA210_DMIC_LP_BIQUAD_1_COEF_4,0x0}, +};I'd add a space on the right side of
}, for consistency with the left.
Quoted 4 lines
Do you mean like this?
{TEGRA210_DMIC_TX_INT_MASK,0x00000001},
{TEGRA210_DMIC_TX_CIF_CTRL,0x00007700},
. . .
Yes
PATCH v2 4/9 ASoC: tegra: add Tegra210 based I2S driver
In reply to Sameer PujarThe 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 | 939 +++++++++++++++++++++++++++++++++++++++++ sound/soc/tegra/tegra210_i2s.h | 132 ++++++ 4 files changed, 1083 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
@@ -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
@@ -10,6 +10,7 @@ snd-soc-tegra30-ahub-objs := tegra30_ahub.o snd-soc-tegra30-i2s-objs := tegra30_i2s.o snd-soc-tegra-cif-objs := tegra_cif.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
@@ -21,6 +22,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 +939 -0
939 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
Re: [PATCH v2 4/9] ASoC: tegra: add Tegra210 based I2S driver
30.01.2020 13:33, Sameer Pujar пишет:
...
Quoted 7 lines
sound/soc/tegra/tegra210_i2s.c new file +7
-0+static const int tegra210_cif_fmt[] = { +0 , +TEGRA_ACIF_BITS_16 , +TEGRA_ACIF_BITS_32 , +}; + +static const int tegra210_i2s_bit_fmt[] = {
sound/soc/tegra/tegra210_i2s.c line 440
Quoted 10 lines
sound/soc/tegra/tegra210_i2s.c new file +10
-0+0 , +I2S_BITS_16 , + I2S_BITS_32, +}; + +static const int tegra210_i2s_sample_size[] = { +0 , +16 , +32 , +};
static const *unsigned* int?
RE: [PATCH v2 4/9] ASoC: tegra: add Tegra210 based I2S driver
From: f Dmitry Osipenko
Quoted 15 lines
Sent: 06 February 2020 16:59
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 11 lines
sound/soc/tegra/tegra210_i2s.c new file +11
-0+static const int tegra210_cif_fmt[] = { +0 , +TEGRA_ACIF_BITS_16 , +TEGRA_ACIF_BITS_32 , +}; + +static const int tegra210_i2s_bit_fmt[] = { +0 , +I2S_BITS_16 , +I2S_BITS_32 , +};
Quoted 8 lines
sound/soc/tegra/tegra210_i2s.c line 440
Quoted 6 lines
sound/soc/tegra/tegra210_i2s.c new file +6
-0+ +static const int tegra210_i2s_sample_size[] = { +0 , +16 , +32 , +};static const *unsigned* int?
Or get rid of the table lookups completely.
Assuming the index is never zero then the value
can be calculated as (const_a + const_b * index).
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
Re: [PATCH v2 4/9] ASoC: tegra: add Tegra210 based I2S driver
Quoted 26 lines · David Laight
External email: Use caution opening links or attachments
From: f Dmitry Osipenko
Quoted 14 lines
Sent: 06 February 2020 16:59
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 10 lines
sound/soc/tegra/tegra210_i2s.c new file +10
-0+static const int tegra210_cif_fmt[] = { +0 , +TEGRA_ACIF_BITS_16 , +TEGRA_ACIF_BITS_32 , +}; + +static const int tegra210_i2s_bit_fmt[] = { +0 , +I2S_BITS_16 , +I2S_BITS_32 ,Quoted 8 lines
sound/soc/tegra/tegra210_i2s.c line 440
Quoted 7 lines
sound/soc/tegra/tegra210_i2s.c new file +7
-0+}; + +static const int tegra210_i2s_sample_size[] = { +0 , +16 , +32 , +};static const *unsigned* int?
Quoted 3 lines
Or get rid of the table lookups completely.
Assuming the index is never zero then the value
can be calculated as (const_a+const_b* index).
All above tables are mapped to tegra210_i2s_format_text[]. Additions/removal of entries will require changes in equation. It is better keep the mapping as it is.
Quoted 6 lines
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
Re: [PATCH v2 4/9] ASoC: tegra: add Tegra210 based I2S driver
In reply to Dmitry OsipenkoQuoted 15 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 10 lines
sound/soc/tegra/tegra210_i2s.c new file +10
-0+static const int tegra210_cif_fmt[] = { +0 , +TEGRA_ACIF_BITS_16 , +TEGRA_ACIF_BITS_32 , +}; + +static const int tegra210_i2s_bit_fmt[] = { +0 , +I2S_BITS_16 , +I2S_BITS_32 ,
Quoted 8 lines
sound/soc/tegra/tegra210_i2s.c line 440
Quoted 7 lines
sound/soc/tegra/tegra210_i2s.c new file +7
-0+}; + +static const int tegra210_i2s_sample_size[] = { +0 , +16 , +32 , +};static const *unsigned* int?
will do.
PATCH v2 5/9 ASoC: tegra: add Tegra210 based AHUB driver
In reply to Sameer PujarThe 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 | 653 ++++++++++++++++++++++++++++++++++++++++ sound/soc/tegra/tegra210_ahub.h | 125 ++++++++ 4 files changed, 790 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
@@ -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
@@ -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-tegra-cif-objs := tegra_cif.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
@@ -22,6 +23,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 +653 -0
653 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
Re: [PATCH v2 5/9] ASoC: tegra: add Tegra210 based AHUB driver
30.01.2020 13:33, Sameer Pujar пишет:
...
sound/soc/tegra/tegra210_ahub.c line 579
Quoted 9 lines
sound/soc/tegra/tegra210_ahub.c new file +9
-0+static int tegra_ahub_probe (struct platform_device *pdev) +{ +struct tegra_ahub *ahub; +void __iomem *regs; +int ret; + + ahub =devm_kcalloc (&pdev->dev,1 ,sizeof (*ahub),GFP_KERNEL ); +if (!ahub) +return -ENOMEM ;
ahub = devm_kzalloc(&pdev->dev, sizeof(*ahub), GFP_KERNEL);
Re: [PATCH v2 5/9] ASoC: tegra: add Tegra210 based AHUB driver
Quoted 5 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...
Quoted 10 lines
sound/soc/tegra/tegra210_ahub.c line 579
Quoted 9 lines
sound/soc/tegra/tegra210_ahub.c new file +9
-0+static int tegra_ahub_probe (struct platform_device *pdev) +{ +struct tegra_ahub *ahub; +void __iomem *regs; +int ret; + + ahub =devm_kcalloc (&pdev->dev,1 ,sizeof (*ahub),GFP_KERNEL ); +if (!ahub) +return -ENOMEM ;ahub =
devm_kzalloc(&pdev->dev, sizeof(*ahub), GFP_KERNEL);
Earlier I had the impression that it won't memset it to 0. Now looking at the implementation I see that it uses '__GFP_ZERO' flag, which I think would initialize it to '0'. Will update. Thanks.
Re: [PATCH v2 5/9] ASoC: tegra: add Tegra210 based AHUB driver
In reply to Sameer Pujar30.01.2020 13:33, Sameer Pujar пишет:
...
sound/soc/tegra/tegra210_ahub.c line 612
Quoted 9 lines
sound/soc/tegra/tegra210_ahub.c new file +9
-0+ ret =devm_snd_soc_register_component (&pdev->dev, + ahub->soc_data->cmpnt_drv, + ahub->soc_data->dai_drv, + ahub->soc_data->num_dais); +if (ret <0 ) { +dev_err (&pdev->dev,"failed to register component, err: %d\n" , + ret); +return ret; + }
In the the patch #4 ("ASoC: tegra: add Tegra210 based I2S driver") I see the following:
ret = devm_snd_soc_register_component(dev, &tegra210_i2s_cmpnt,
tegra210_i2s_dais,
ARRAY_SIZE(tegra210_i2s_dais));
if (ret != 0) {
dev_err(dev, "can't register I2S component, err: %d\n", ret);
return ret;
}Please be consistent in regards to errors checking. The correct variant should be: if (ret != 0). Usually error codes are a negative value, but it is much safer to check whether value isn't 0 in all cases where positive value isn't expected to happen.
I'd also recommend to rename all "ret" variables to "err" everywhere in the code where returned value is used only for errors checking. This will make code more explicit, and hence, easier to read and follow.
So, it will be nicer to write it as:
err = devm_snd_soc_register_component(&pdev->dev,
ahub->soc_data->cmpnt_drv,
ahub->soc_data->dai_drv,
ahub->soc_data->num_dais);
if (err) {
dev_err(&pdev->dev, "failed to register component: %d\n", err);
return err;
}Re: [PATCH v2 5/9] ASoC: tegra: add Tegra210 based AHUB driver
30.01.2020 20:09, Dmitry Osipenko пишет:
Quoted 5 lines
30.01.2020 13:33, Sameer Pujar пишет:
...sound/soc/tegra/tegra210_ahub.c line 609
Quoted 1 line
sound/soc/tegra/tegra210_ahub.c new file +1
-0+ dev_err(&pdev->dev, "failed to register component, err: %d\n",dev_err(dev, "can't register I2S component, err: %d\n", ret);
Also, will be nice to have wording of the text messages to be consistent everywhere.
Re: [PATCH v2 5/9] ASoC: tegra: add Tegra210 based AHUB driver
Quoted 11 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
30.01.2020 20:09, Dmitry Osipenko пишет:
Quoted 4 lines
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 1 line
+ dev_err(&pdev->dev, "failed to register component, err: %d\n",
dev_err(dev, "can't register I2S component, err: %d\n", ret);Also, will be nice to have wording of the text messages to be consistent everywhere.
OK.
Re: [PATCH v2 5/9] ASoC: tegra: add Tegra210 based AHUB driver
In reply to Dmitry OsipenkoQuoted 25 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...sound/soc/tegra/tegra210_ahub.c line 612
Quoted 9 lines
sound/soc/tegra/tegra210_ahub.c new file +9
-0+ ret =devm_snd_soc_register_component (&pdev->dev, + ahub->soc_data->cmpnt_drv, + ahub->soc_data->dai_drv, + ahub->soc_data->num_dais); +if (ret <0 ) { +dev_err (&pdev->dev,"failed to register component, err: %d\n" , + ret); +return ret; + }In the the patch #4 ("ASoC: tegra: add Tegra210 based I2S driver") I see the following:
ret = devm_snd_soc_register_component(dev, &tegra210_i2s_cmpnt, tegra210_i2s_dais, ARRAY_SIZE(tegra210_i2s_dais)); if (ret != 0) { dev_err(dev, "can't register I2S component, err: %d\n", ret); return ret; }
Quoted 4 lines
Please be consistent in regards to errors checking. The correct variant should be: if (ret != 0). Usually error codes are a negative value, but it is much safer to check whether value isn't 0 in all cases where positive value isn't expected to happen.
yes "if (ret)" is good enough in such cases.
Quoted 4 lines
I'd also recommend to rename all "ret" variables to "err" everywhere in the code where returned value is used only for errors checking. This will make code more explicit, and hence, easier to read and follow.
OK, I will update it to 'err' for better.
Quoted 11 lines
So, it will be nicer to write it as:
err = devm_snd_soc_register_component(&pdev->dev, ahub->soc_data->cmpnt_drv, ahub->soc_data->dai_drv, ahub->soc_data->num_dais); if (err) { dev_err(&pdev->dev, "failed to register component: %d\n", err); return err; }
Re: [PATCH v2 5/9] ASoC: tegra: add Tegra210 based AHUB driver
In reply to Sameer Pujar30.01.2020 13:33, Sameer Pujar пишет:
...
sound/soc/tegra/tegra210_ahub.c line 17
Quoted 11 lines
sound/soc/tegra/tegra210_ahub.c new file +9
-0+#include <linux/clk.h> +#include <linux/device.h> +#include <linux/module.h> +#include <linux/of_platform.h> +#include <linux/platform_device.h> +#include <linux/pm_runtime.h> +#include <linux/regmap.h> +#include <sound/soc.h> +#include "tegra210_ahub.h"
Nit: I'd separate the per-directory includes with a blank line, like it done by the most of existing drivers, for consistency.
Re: [PATCH v2 5/9] ASoC: tegra: add Tegra210 based AHUB driver
Quoted 5 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...
Quoted 11 lines
sound/soc/tegra/tegra210_ahub.c line 17
Quoted 9 lines
sound/soc/tegra/tegra210_ahub.c new file +9
-0+#include <linux/clk.h> +#include <linux/device.h> +#include <linux/module.h> +#include <linux/of_platform.h> +#include <linux/platform_device.h> +#include <linux/pm_runtime.h> +#include <linux/regmap.h> +#include <sound/soc.h> +#include "tegra210_ahub.h" Nit: I'd separate the per-directory includes with a blank line, like it done by the most of existing drivers, for consistency.
Hi Dmitry,
I'd assume these are the only review comments (which includes your other replies for v2 5/9) for the series. Let me know otherwise.
It would help me to discuss all the issues at once, finalize changes for v3 and so that we can avoid multiple iterations.
Thanks,
Sameer.
Re: [PATCH v2 5/9] ASoC: tegra: add Tegra210 based AHUB driver
31.01.2020 06:12, Sameer Pujar пишет:
Quoted 20 lines · Dmitry Osipenko
Quoted 5 lines
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 11 lines
sound/soc/tegra/tegra210_ahub.c line 17
Quoted 9 lines
sound/soc/tegra/tegra210_ahub.c new file +9
-0+#include <linux/clk.h> +#include <linux/device.h> +#include <linux/module.h> +#include <linux/of_platform.h> +#include <linux/platform_device.h> +#include <linux/pm_runtime.h> +#include <linux/regmap.h> +#include <sound/soc.h> +#include "tegra210_ahub.h" Nit: I'd separate the per-directory includes with a blank line, like it done by the most of existing drivers, for consistency.
Quoted 8 lines
Hi Dmitry,
I'd assume these are the only review comments (which includes your other replies for v2 5/9) for the series.
Let me know otherwise.It would help me to discuss all the issues at once, finalize changes for v3 and so that we can avoid multiple iterations.
Hello Sameer,
I'll take another look at the patches around Monday.
In general, you should wait for a week or two if you're expecting to get more comments.
There is now more than month for you to finish this series. If you have any other patches that depend on this series, then you may send them as RFC and explicitly state that they depend on another series.
Re: [PATCH v2 5/9] ASoC: tegra: add Tegra210 based AHUB driver
In reply to Dmitry OsipenkoQuoted 5 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...
Quoted 11 lines
sound/soc/tegra/tegra210_ahub.c line 17
Quoted 9 lines
sound/soc/tegra/tegra210_ahub.c new file +9
-0+#include <linux/clk.h> +#include <linux/device.h> +#include <linux/module.h> +#include <linux/of_platform.h> +#include <linux/platform_device.h> +#include <linux/pm_runtime.h> +#include <linux/regmap.h> +#include <sound/soc.h> +#include "tegra210_ahub.h" Nit: I'd separate the per-directory includes with a blank line, like it done by the most of existing drivers, for consistency.
I don't see this being followed consistently for sound drivers. I think it is good as it is, it appears compact and clean.
PATCH v2 6/9 ASoC: tegra: add Tegra186 based DSPK driver
In reply to Sameer PujarThe 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 | 512 ++++++++++++++++++++++++++++++++++++++++ sound/soc/tegra/tegra186_dspk.h | 73 ++++++ 4 files changed, 600 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
@@ -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
@@ -12,6 +12,7 @@ snd-soc-tegra-cif-objs := tegra_cif.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
@@ -25,6 +26,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 +512 -0
512 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
Re: [PATCH v2 6/9] ASoC: tegra: add Tegra186 based DSPK driver
30.01.2020 13:33, Sameer Pujar пишет:
sound/soc/tegra/tegra186_dspk.c line 496
Quoted 6 lines
sound/soc/tegra/tegra186_dspk.c new file +6
-0+static const struct dev_pm_ops tegra186_dspk_pm_ops = { + SET_RUNTIME_PM_OPS(tegra186_dspk_runtime_suspend, + tegra186_dspk_runtime_resume, NULL) +SET_LATE_SYSTEM_SLEEP_PM_OPS (pm_runtime_force_suspend, + pm_runtime_force_resume) +};
Could you please explain why drivers need the "late" system sleep?
Re: [PATCH v2 6/9] ASoC: tegra: add Tegra186 based DSPK driver
Quoted 11 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
sound/soc/tegra/tegra186_dspk.c line 496
Quoted 6 lines
sound/soc/tegra/tegra186_dspk.c new file +6
-0+static const struct dev_pm_ops tegra186_dspk_pm_ops = { + SET_RUNTIME_PM_OPS(tegra186_dspk_runtime_suspend, + tegra186_dspk_runtime_resume, NULL) +SET_LATE_SYSTEM_SLEEP_PM_OPS (pm_runtime_force_suspend, + pm_runtime_force_resume) +};Could you please explain why drivers need the "late" system sleep?
It was done to ensure core drivers are suspended first and defer the codec driver suspend
Re: [PATCH v2 6/9] ASoC: tegra: add Tegra186 based DSPK driver
07.02.2020 14:26, Sameer Pujar пишет:
Quoted 15 lines · Dmitry Osipenko
Quoted 11 lines
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
sound/soc/tegra/tegra186_dspk.c line 496
Quoted 6 lines
sound/soc/tegra/tegra186_dspk.c new file +6
-0+static const struct dev_pm_ops tegra186_dspk_pm_ops = { + SET_RUNTIME_PM_OPS(tegra186_dspk_runtime_suspend, + tegra186_dspk_runtime_resume, NULL) + SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) +};Could you please explain why drivers need the "late" system sleep?
Quoted 2 lines
It was done to ensure core drivers are suspended first and defer the codec driver suspend
Suspend order is opposite to the drivers registration order. If there is no real problem with that, then you should use the default suspend level. Please don't try to fix a non-existent problems.
Re: [PATCH v2 6/9] ASoC: tegra: add Tegra186 based DSPK driver
Quoted 17 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
07.02.2020 14:26, Sameer Pujar пишет:
Quoted 13 lines · Dmitry Osipenko
Quoted 11 lines
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
sound/soc/tegra/tegra186_dspk.c line 496
Quoted 6 lines
sound/soc/tegra/tegra186_dspk.c new file +6
-0+static const struct dev_pm_ops tegra186_dspk_pm_ops = { + SET_RUNTIME_PM_OPS(tegra186_dspk_runtime_suspend, + tegra186_dspk_runtime_resume, NULL) +SET_LATE_SYSTEM_SLEEP_PM_OPS (pm_runtime_force_suspend, + pm_runtime_force_resume) +};Could you please explain why drivers need the "late" system sleep?
Quoted 6 lines
Quoted 2 lines
It was done to ensure core drivers are suspended first and defer the codec driver suspend
Suspend order is opposite to the drivers registration order. If there is no real problem with that, then you should use the default suspend
level. Please don't try to fix a non-existent problems.
No. This was done specifically to allow sound core to first stop any ongoing audio activity during normal suspend and ensure a safe suspend of AHUB devices by doing a LATE suspend.
Jon Hunter
maintainerRe: [PATCH v2 6/9] ASoC: tegra: add Tegra186 based DSPK driver
Quoted 22 lines · Sameer Pujar
Quoted 19 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
07.02.2020 14:26, Sameer Pujar пишет:
Quoted 15 lines · Dmitry Osipenko
Quoted 11 lines
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
sound/soc/tegra/tegra186_dspk.c line 496
Quoted 6 lines
sound/soc/tegra/tegra186_dspk.c new file +6
-0+static const struct dev_pm_ops tegra186_dspk_pm_ops = { + SET_RUNTIME_PM_OPS(tegra186_dspk_runtime_suspend, + tegra186_dspk_runtime_resume, NULL) + SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) +};Could you please explain why drivers need the "late" system sleep?
It was done to ensure core drivers are suspended first and defer the codec driver suspend
Quoted 8 lines
Quoted 4 lines
Suspend order is opposite to the drivers registration order. If there is no real problem with that, then you should use the default suspend
level. Please don't try to fix a non-existent problems.
No. This was done specifically to allow sound core to first stop any ongoing audio activity during normal suspend and ensure a safe suspend of AHUB devices by doing a LATE suspend.
What Dmitry is saying is that if the DSPK driver is registered after the sound core then we will not need to suspend in the late phase. The DSPK device should only be registered once the sound core is loaded, because otherwise we should fail to register it with the sound core. So I don't think we need this to be late afterall.
Jon
Signature · 1 line
nvpublic
Re: [PATCH v2 6/9] ASoC: tegra: add Tegra186 based DSPK driver
Quoted 24 lines · Jon Hunter
Quoted 23 lines · Sameer Pujar
Quoted 21 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
07.02.2020 14:26, Sameer Pujar пишет:
Quoted 12 lines · Dmitry Osipenko
Quoted 11 lines
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
sound/soc/tegra/tegra186_dspk.c line 496
Quoted 6 lines
sound/soc/tegra/tegra186_dspk.c new file +6
-0+static const struct dev_pm_ops tegra186_dspk_pm_ops = { + SET_RUNTIME_PM_OPS(tegra186_dspk_runtime_suspend, + tegra186_dspk_runtime_resume, NULL) + SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) +};Could you please explain why drivers need the "late" system sleep?
Quoted 2 lines
It was done to ensure core drivers are suspended first and defer the codec driver suspend
Suspend order is opposite to the drivers registration order. If there is no real problem with that, then you should use the default suspend level. Please don't try to fix a non-existent problems.
Quoted 8 lines
Quoted 3 lines
No. This was done specifically to allow sound core to first stop any ongoing audio activity during normal suspend and ensure a safe suspend of AHUB devices by doing a LATE suspend.
What Dmitry is saying is that if the DSPK driver is registered after the sound core then we will not need to suspend in the late phase. The DSPK device should only be registered once the sound core is loaded, because otherwise we should fail to register it with the sound core. So I don't think we need this to be late afterall.
I was originally thinking if DMA is the main reason for using LATE suspend for audio drivers as well. I did a small sanity check and appears normal suspend is fine. I will update the drivers with normal suspend. If we come across any issue later, it can be addressed separately. Thanks Dmitry and Jon.
Quoted 3 lines
Jon
PATCH v2 7/9 ASoC: tegra: add Tegra210 based ADMAIF driver
In reply to Sameer PujarADMAIF 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 below compatible bindings.
- "nvidia,tegra210-admaif" for Tegra210
- "nvidia,tegra186-admaif" for Tegra186 and Tegra194
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 | 886 ++++++++++++++++++++++++++++++++++++++ sound/soc/tegra/tegra210_admaif.h | 164 +++++++ sound/soc/tegra/tegra_pcm.c | 222 +++++++++- sound/soc/tegra/tegra_pcm.h | 23 +- 6 files changed, 1307 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
@@ -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
@@ -13,6 +13,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
@@ -27,6 +28,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 +886 -0
886 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
@@ -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
PATCH v2 8/9 arm64: tegra: add AHUB components for few Tegra chips
In reply to Sameer PujarThis 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
@@ -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
PATCH v2 9/9 arm64: tegra: enable AHUB modules for few Tegra chips
In reply to Sameer PujarThis 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
@@ -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
@@ -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
@@ -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
30.01.2020 13:33, Sameer Pujar пишет:
...
Quoted 1 line
sound/soc/tegra/Kconfig | 56 ++
Probably won't hurt to enable the new drivers in the arch/arm64/configs/defconfig?
Quoted 8 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 1 line
sound/soc/tegra/Kconfig | 56 ++Probably won't hurt to enable the new drivers in the
arch/arm64/configs/defconfig?
Do you mean, if drivers can be enabled?
07.02.2020 14:30, Sameer Pujar пишет:
Quoted 13 lines · Dmitry Osipenko
Quoted 8 lines
External email: Use caution opening links or attachments
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 1 line
sound/soc/tegra/Kconfig | 56 ++
Probably won't hurt to enable the new drivers in the
arch/arm64/configs/defconfig?Do you mean, if drivers can be enabled?
Yes, I mean to enable them in the default kernel configuration.
Quoted 9 lines · Dmitry Osipenko
External email: Use caution opening links or attachments
07.02.2020 14:30, Sameer Pujar пишет:
Quoted 5 lines · Dmitry Osipenko
Quoted 3 lines
External email: Use caution opening links or attachments
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
30.01.2020 13:33, Sameer Pujar пишет:
...Quoted 1 line
sound/soc/tegra/Kconfig | 56 ++Probably won't hurt to enable the new drivers in the
arch/arm64/configs/defconfig?Do you mean, if drivers can be enabled?
Yes, I mean to enable them in the default kernel configuration.
Yes these can be enabled by default. I can push a defconfig patch, if that is what you were referring in the beginning.