2022-06-05 13:55:09

by Sameer Pujar

[permalink] [raw]
Subject: [PATCH v3 0/6] OPE support on Tegra210 and later

This series adds support for Output Prcoessing Module (OPE) module on
Tegra210 and later generations of SoCs. OPE is a client of AHUB and
it has sub blocks of PEQ (Parametric Equalizer) and MBDRC (Multi Band
Dynamic Range Compressor) for data processing.

An ASoC component is registered for OPE, which includes PEQ and MBDRC
functions as well. This can be plugged in audio path using ALSA mixer
controls. The series adds necessary binding documentaion, driver and
DT binding patches to enable OPE module on Jetson platforms.


Changelog
=========

v2 -> v3:
---------
* Drop "Device Tree Bindings" string from bindind doc titles for
OPE, PEQ and MBDRC.

v1 -> v2:
---------
* Use generic node names for OPE, PEQ and MBDRC devices. Update
binding doc and DT patches for this.
* Remove redundant nodename rule enforcement from
OPE, PEQ and MBDRC nodes. Update binding doc patch for this.
* Fix spaces before binding doc examples and remove '|'
from binding doc descriptions.


Sameer Pujar (6):
ASoC: tegra: Add binding doc for OPE module
ASoC: tegra: Add Tegra210 based OPE driver
ASoC: tegra: AHUB routes for OPE module
arm64: defconfig: Build Tegra OPE module
arm64: tegra: Add OPE device on Tegra210 and later
arm64: tegra: Enable OPE on various platforms

.../bindings/sound/nvidia,tegra210-ahub.yaml | 4 +
.../bindings/sound/nvidia,tegra210-mbdrc.yaml | 47 +
.../bindings/sound/nvidia,tegra210-ope.yaml | 87 ++
.../bindings/sound/nvidia,tegra210-peq.yaml | 48 +
arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 43 +
arch/arm64/boot/dts/nvidia/tegra186.dtsi | 23 +
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts | 43 +
.../arm64/boot/dts/nvidia/tegra194-p3509-0000.dtsi | 43 +
arch/arm64/boot/dts/nvidia/tegra194.dtsi | 23 +
arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 84 ++
arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 84 ++
arch/arm64/boot/dts/nvidia/tegra210.dtsi | 40 +
.../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 43 +
arch/arm64/boot/dts/nvidia/tegra234.dtsi | 23 +
arch/arm64/configs/defconfig | 1 +
sound/soc/tegra/Kconfig | 9 +
sound/soc/tegra/Makefile | 2 +
sound/soc/tegra/tegra210_ahub.c | 39 +-
sound/soc/tegra/tegra210_mbdrc.c | 1012 ++++++++++++++++++++
sound/soc/tegra/tegra210_mbdrc.h | 215 +++++
sound/soc/tegra/tegra210_ope.c | 419 ++++++++
sound/soc/tegra/tegra210_ope.h | 90 ++
sound/soc/tegra/tegra210_peq.c | 434 +++++++++
sound/soc/tegra/tegra210_peq.h | 56 ++
24 files changed, 2908 insertions(+), 4 deletions(-)
create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-mbdrc.yaml
create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-ope.yaml
create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-peq.yaml
create mode 100644 sound/soc/tegra/tegra210_mbdrc.c
create mode 100644 sound/soc/tegra/tegra210_mbdrc.h
create mode 100644 sound/soc/tegra/tegra210_ope.c
create mode 100644 sound/soc/tegra/tegra210_ope.h
create mode 100644 sound/soc/tegra/tegra210_peq.c
create mode 100644 sound/soc/tegra/tegra210_peq.h

--
2.7.4


2022-06-06 05:00:45

by Sameer Pujar

[permalink] [raw]
Subject: [PATCH v3 3/6] ASoC: tegra: AHUB routes for OPE module

Add AHUB routes for OPE module. The OPE module can be plugged into audio
path as per the need. The routing controls can be used to setup the audio
path with OPE similar to the already existing routes. The support is added
on Tegra210 and later Tegra SoCs where OPE module is present.

Signed-off-by: Sameer Pujar <[email protected]>
---
sound/soc/tegra/tegra210_ahub.c | 39 +++++++++++++++++++++++++++++++++++----
1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/sound/soc/tegra/tegra210_ahub.c b/sound/soc/tegra/tegra210_ahub.c
index e1f90da..b38d205 100644
--- a/sound/soc/tegra/tegra210_ahub.c
+++ b/sound/soc/tegra/tegra210_ahub.c
@@ -170,6 +170,11 @@ static struct snd_soc_dai_driver tegra210_ahub_dais[] = {
DAI(MIXER1 TX3),
DAI(MIXER1 TX4),
DAI(MIXER1 TX5),
+ /* XBAR -> OPE -> XBAR */
+ DAI(OPE1 RX),
+ DAI(OPE1 TX),
+ DAI(OPE2 RX),
+ DAI(OPE2 TX),
};

static struct snd_soc_dai_driver tegra186_ahub_dais[] = {
@@ -294,6 +299,9 @@ static struct snd_soc_dai_driver tegra186_ahub_dais[] = {
DAI(ASRC1 RX6),
DAI(ASRC1 TX6),
DAI(ASRC1 RX7),
+ /* XBAR -> OPE -> XBAR */
+ DAI(OPE1 RX),
+ DAI(OPE1 TX),
};

static const char * const tegra210_ahub_mux_texts[] = {
@@ -337,6 +345,8 @@ static const char * const tegra210_ahub_mux_texts[] = {
"MIXER1 TX3",
"MIXER1 TX4",
"MIXER1 TX5",
+ "OPE1",
+ "OPE2",
};

static const char * const tegra186_ahub_mux_texts[] = {
@@ -408,6 +418,7 @@ static const char * const tegra186_ahub_mux_texts[] = {
"ASRC1 TX4",
"ASRC1 TX5",
"ASRC1 TX6",
+ "OPE1",
};

static const unsigned int tegra210_ahub_mux_values[] = {
@@ -459,6 +470,9 @@ static const unsigned int tegra210_ahub_mux_values[] = {
MUX_VALUE(1, 2),
MUX_VALUE(1, 3),
MUX_VALUE(1, 4),
+ /* OPE */
+ MUX_VALUE(2, 0),
+ MUX_VALUE(2, 1),
};

static const unsigned int tegra186_ahub_mux_values[] = {
@@ -540,6 +554,8 @@ static const unsigned int tegra186_ahub_mux_values[] = {
MUX_VALUE(3, 27),
MUX_VALUE(3, 28),
MUX_VALUE(3, 29),
+ /* OPE */
+ MUX_VALUE(2, 0),
};

/* Controls for t210 */
@@ -584,6 +600,8 @@ MUX_ENUM_CTRL_DECL(t210_mixer17_tx, 0x26);
MUX_ENUM_CTRL_DECL(t210_mixer18_tx, 0x27);
MUX_ENUM_CTRL_DECL(t210_mixer19_tx, 0x28);
MUX_ENUM_CTRL_DECL(t210_mixer110_tx, 0x29);
+MUX_ENUM_CTRL_DECL(t210_ope1_tx, 0x40);
+MUX_ENUM_CTRL_DECL(t210_ope2_tx, 0x41);

/* Controls for t186 */
MUX_ENUM_CTRL_DECL_186(t186_admaif1_tx, 0x00);
@@ -657,6 +675,7 @@ MUX_ENUM_CTRL_DECL_186(t186_asrc14_tx, 0x6f);
MUX_ENUM_CTRL_DECL_186(t186_asrc15_tx, 0x70);
MUX_ENUM_CTRL_DECL_186(t186_asrc16_tx, 0x71);
MUX_ENUM_CTRL_DECL_186(t186_asrc17_tx, 0x72);
+MUX_ENUM_CTRL_DECL_186(t186_ope1_tx, 0x40);

/* Controls for t234 */
MUX_ENUM_CTRL_DECL_234(t234_mvc1_tx, 0x44);
@@ -758,6 +777,8 @@ static const struct snd_soc_dapm_widget tegra210_ahub_widgets[] = {
TX_WIDGETS("MIXER1 TX3"),
TX_WIDGETS("MIXER1 TX4"),
TX_WIDGETS("MIXER1 TX5"),
+ WIDGETS("OPE1", t210_ope1_tx),
+ WIDGETS("OPE2", t210_ope2_tx),
};

static const struct snd_soc_dapm_widget tegra186_ahub_widgets[] = {
@@ -867,6 +888,7 @@ static const struct snd_soc_dapm_widget tegra186_ahub_widgets[] = {
TX_WIDGETS("ASRC1 TX4"),
TX_WIDGETS("ASRC1 TX5"),
TX_WIDGETS("ASRC1 TX6"),
+ WIDGETS("OPE1", t186_ope1_tx),
};

static const struct snd_soc_dapm_widget tegra234_ahub_widgets[] = {
@@ -976,6 +998,7 @@ static const struct snd_soc_dapm_widget tegra234_ahub_widgets[] = {
TX_WIDGETS("ASRC1 TX4"),
TX_WIDGETS("ASRC1 TX5"),
TX_WIDGETS("ASRC1 TX6"),
+ WIDGETS("OPE1", t186_ope1_tx),
};

#define TEGRA_COMMON_MUX_ROUTES(name) \
@@ -1018,7 +1041,11 @@ static const struct snd_soc_dapm_widget tegra234_ahub_widgets[] = {
{ name " Mux", "MIXER1 TX2", "MIXER1 TX2 XBAR-RX" }, \
{ name " Mux", "MIXER1 TX3", "MIXER1 TX3 XBAR-RX" }, \
{ name " Mux", "MIXER1 TX4", "MIXER1 TX4 XBAR-RX" }, \
- { name " Mux", "MIXER1 TX5", "MIXER1 TX5 XBAR-RX" },
+ { name " Mux", "MIXER1 TX5", "MIXER1 TX5 XBAR-RX" }, \
+ { name " Mux", "OPE1", "OPE1 XBAR-RX" },
+
+#define TEGRA210_ONLY_MUX_ROUTES(name) \
+ { name " Mux", "OPE2", "OPE2 XBAR-RX" },

#define TEGRA186_ONLY_MUX_ROUTES(name) \
{ name " Mux", "ADMAIF11", "ADMAIF11 XBAR-RX" }, \
@@ -1050,10 +1077,11 @@ static const struct snd_soc_dapm_widget tegra234_ahub_widgets[] = {
{ name " Mux", "ASRC1 TX5", "ASRC1 TX5 XBAR-RX" }, \
{ name " Mux", "ASRC1 TX6", "ASRC1 TX6 XBAR-RX" },

-#define TEGRA210_MUX_ROUTES(name) \
- TEGRA_COMMON_MUX_ROUTES(name)
+#define TEGRA210_MUX_ROUTES(name) \
+ TEGRA_COMMON_MUX_ROUTES(name) \
+ TEGRA210_ONLY_MUX_ROUTES(name)

-#define TEGRA186_MUX_ROUTES(name) \
+#define TEGRA186_MUX_ROUTES(name) \
TEGRA_COMMON_MUX_ROUTES(name) \
TEGRA186_ONLY_MUX_ROUTES(name)

@@ -1121,6 +1149,8 @@ static const struct snd_soc_dapm_route tegra210_ahub_routes[] = {
TEGRA210_MUX_ROUTES("MIXER1 RX8")
TEGRA210_MUX_ROUTES("MIXER1 RX9")
TEGRA210_MUX_ROUTES("MIXER1 RX10")
+ TEGRA210_MUX_ROUTES("OPE1")
+ TEGRA210_MUX_ROUTES("OPE2")
};

static const struct snd_soc_dapm_route tegra186_ahub_routes[] = {
@@ -1215,6 +1245,7 @@ static const struct snd_soc_dapm_route tegra186_ahub_routes[] = {
TEGRA186_MUX_ROUTES("ASRC1 RX5")
TEGRA186_MUX_ROUTES("ASRC1 RX6")
TEGRA186_MUX_ROUTES("ASRC1 RX7")
+ TEGRA186_MUX_ROUTES("OPE1")
};

static const struct snd_soc_component_driver tegra210_ahub_component = {
--
2.7.4

2022-06-06 05:34:20

by Sameer Pujar

[permalink] [raw]
Subject: [PATCH v3 4/6] arm64: defconfig: Build Tegra OPE module

Output Processing Engine (OPE) module is a client of AHUB on Tegra210
and later generations of Tegra SoCs. Enable the driver build to use
this in audio path.

Signed-off-by: Sameer Pujar <[email protected]>
---
arch/arm64/configs/defconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 7d11053..3e154cb 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -808,6 +808,7 @@ 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_TEGRA210_OPE=m
CONFIG_SND_SOC_TEGRA186_ASRC=m
CONFIG_SND_SOC_TEGRA186_DSPK=m
CONFIG_SND_SOC_TEGRA210_ADMAIF=m
--
2.7.4

2022-06-08 03:58:48

by Mark Brown

[permalink] [raw]
Subject: Re: (subset) [PATCH v3 0/6] OPE support on Tegra210 and later

On Fri, 3 Jun 2022 12:06:06 +0530, Sameer Pujar wrote:
> This series adds support for Output Prcoessing Module (OPE) module on
> Tegra210 and later generations of SoCs. OPE is a client of AHUB and
> it has sub blocks of PEQ (Parametric Equalizer) and MBDRC (Multi Band
> Dynamic Range Compressor) for data processing.
>
> An ASoC component is registered for OPE, which includes PEQ and MBDRC
> functions as well. This can be plugged in audio path using ALSA mixer
> controls. The series adds necessary binding documentaion, driver and
> DT binding patches to enable OPE module on Jetson platforms.
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/6] ASoC: tegra: Add binding doc for OPE module
commit: 45c6c5e052df2ee0d87e74743d8bb72e70fd0887
[2/6] ASoC: tegra: Add Tegra210 based OPE driver
commit: 7358a803c778f28314721e78339f3fa5b787f55c
[3/6] ASoC: tegra: AHUB routes for OPE module
commit: 7ee0910d03168535ffeea2f4ce924eebb3b24863

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark