ASoC: tegra: AHUB routes for ASRC module
authorSameer Pujar <spujar@nvidia.com>
Thu, 31 Mar 2022 14:03:29 +0000 (19:33 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 4 Apr 2022 07:39:15 +0000 (08:39 +0100)
Add AHUB routes for ASRC module. The ASRC module can be plugged into audio
path as per the need. The routing controls can be used to setup the audio
path with ASRC similar to the already existing routes. The routes are added
to Tegra186 and later Tegra SoCs where ASRC module is present.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1648735412-32220-4-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/tegra/tegra210_ahub.c

index bccf8b8..e1f90da 100644 (file)
@@ -280,6 +280,20 @@ static struct snd_soc_dai_driver tegra186_ahub_dais[] = {
        DAI(MIXER1 TX3),
        DAI(MIXER1 TX4),
        DAI(MIXER1 TX5),
+       /* XBAR -> ASRC -> XBAR */
+       DAI(ASRC1 RX1),
+       DAI(ASRC1 TX1),
+       DAI(ASRC1 RX2),
+       DAI(ASRC1 TX2),
+       DAI(ASRC1 RX3),
+       DAI(ASRC1 TX3),
+       DAI(ASRC1 RX4),
+       DAI(ASRC1 TX4),
+       DAI(ASRC1 RX5),
+       DAI(ASRC1 TX5),
+       DAI(ASRC1 RX6),
+       DAI(ASRC1 TX6),
+       DAI(ASRC1 RX7),
 };
 
 static const char * const tegra210_ahub_mux_texts[] = {
@@ -388,6 +402,12 @@ static const char * const tegra186_ahub_mux_texts[] = {
        "MIXER1 TX3",
        "MIXER1 TX4",
        "MIXER1 TX5",
+       "ASRC1 TX1",
+       "ASRC1 TX2",
+       "ASRC1 TX3",
+       "ASRC1 TX4",
+       "ASRC1 TX5",
+       "ASRC1 TX6",
 };
 
 static const unsigned int tegra210_ahub_mux_values[] = {
@@ -513,6 +533,13 @@ static const unsigned int tegra186_ahub_mux_values[] = {
        MUX_VALUE(1, 2),
        MUX_VALUE(1, 3),
        MUX_VALUE(1, 4),
+       /* ASRC */
+       MUX_VALUE(3, 24),
+       MUX_VALUE(3, 25),
+       MUX_VALUE(3, 26),
+       MUX_VALUE(3, 27),
+       MUX_VALUE(3, 28),
+       MUX_VALUE(3, 29),
 };
 
 /* Controls for t210 */
@@ -623,6 +650,13 @@ MUX_ENUM_CTRL_DECL_186(t186_mixer17_tx, 0x26);
 MUX_ENUM_CTRL_DECL_186(t186_mixer18_tx, 0x27);
 MUX_ENUM_CTRL_DECL_186(t186_mixer19_tx, 0x28);
 MUX_ENUM_CTRL_DECL_186(t186_mixer110_tx, 0x29);
+MUX_ENUM_CTRL_DECL_186(t186_asrc11_tx, 0x6c);
+MUX_ENUM_CTRL_DECL_186(t186_asrc12_tx, 0x6d);
+MUX_ENUM_CTRL_DECL_186(t186_asrc13_tx, 0x6e);
+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);
 
 /* Controls for t234 */
 MUX_ENUM_CTRL_DECL_234(t234_mvc1_tx, 0x44);
@@ -651,6 +685,13 @@ MUX_ENUM_CTRL_DECL_234(t234_admaif17_tx, 0x60);
 MUX_ENUM_CTRL_DECL_234(t234_admaif18_tx, 0x61);
 MUX_ENUM_CTRL_DECL_234(t234_admaif19_tx, 0x62);
 MUX_ENUM_CTRL_DECL_234(t234_admaif20_tx, 0x63);
+MUX_ENUM_CTRL_DECL_234(t234_asrc11_tx, 0x64);
+MUX_ENUM_CTRL_DECL_234(t234_asrc12_tx, 0x65);
+MUX_ENUM_CTRL_DECL_234(t234_asrc13_tx, 0x66);
+MUX_ENUM_CTRL_DECL_234(t234_asrc14_tx, 0x67);
+MUX_ENUM_CTRL_DECL_234(t234_asrc15_tx, 0x68);
+MUX_ENUM_CTRL_DECL_234(t234_asrc16_tx, 0x69);
+MUX_ENUM_CTRL_DECL_234(t234_asrc17_tx, 0x6a);
 
 /*
  * The number of entries in, and order of, this array is closely tied to the
@@ -813,6 +854,19 @@ static const struct snd_soc_dapm_widget tegra186_ahub_widgets[] = {
        TX_WIDGETS("MIXER1 TX3"),
        TX_WIDGETS("MIXER1 TX4"),
        TX_WIDGETS("MIXER1 TX5"),
+       WIDGETS("ASRC1 RX1", t186_asrc11_tx),
+       WIDGETS("ASRC1 RX2", t186_asrc12_tx),
+       WIDGETS("ASRC1 RX3", t186_asrc13_tx),
+       WIDGETS("ASRC1 RX4", t186_asrc14_tx),
+       WIDGETS("ASRC1 RX5", t186_asrc15_tx),
+       WIDGETS("ASRC1 RX6", t186_asrc16_tx),
+       WIDGETS("ASRC1 RX7", t186_asrc17_tx),
+       TX_WIDGETS("ASRC1 TX1"),
+       TX_WIDGETS("ASRC1 TX2"),
+       TX_WIDGETS("ASRC1 TX3"),
+       TX_WIDGETS("ASRC1 TX4"),
+       TX_WIDGETS("ASRC1 TX5"),
+       TX_WIDGETS("ASRC1 TX6"),
 };
 
 static const struct snd_soc_dapm_widget tegra234_ahub_widgets[] = {
@@ -909,6 +963,19 @@ static const struct snd_soc_dapm_widget tegra234_ahub_widgets[] = {
        TX_WIDGETS("MIXER1 TX3"),
        TX_WIDGETS("MIXER1 TX4"),
        TX_WIDGETS("MIXER1 TX5"),
+       WIDGETS("ASRC1 RX1", t234_asrc11_tx),
+       WIDGETS("ASRC1 RX2", t234_asrc12_tx),
+       WIDGETS("ASRC1 RX3", t234_asrc13_tx),
+       WIDGETS("ASRC1 RX4", t234_asrc14_tx),
+       WIDGETS("ASRC1 RX5", t234_asrc15_tx),
+       WIDGETS("ASRC1 RX6", t234_asrc16_tx),
+       WIDGETS("ASRC1 RX7", t234_asrc17_tx),
+       TX_WIDGETS("ASRC1 TX1"),
+       TX_WIDGETS("ASRC1 TX2"),
+       TX_WIDGETS("ASRC1 TX3"),
+       TX_WIDGETS("ASRC1 TX4"),
+       TX_WIDGETS("ASRC1 TX5"),
+       TX_WIDGETS("ASRC1 TX6"),
 };
 
 #define TEGRA_COMMON_MUX_ROUTES(name)                                  \
@@ -975,7 +1042,13 @@ static const struct snd_soc_dapm_widget tegra234_ahub_widgets[] = {
        { name " Mux",          "ADX4 TX1",     "ADX4 TX1 XBAR-RX" },   \
        { name " Mux",          "ADX4 TX2",     "ADX4 TX2 XBAR-RX" },   \
        { name " Mux",          "ADX4 TX3",     "ADX4 TX3 XBAR-RX" },   \
-       { name " Mux",          "ADX4 TX4",     "ADX4 TX4 XBAR-RX" },
+       { name " Mux",          "ADX4 TX4",     "ADX4 TX4 XBAR-RX" },   \
+       { name " Mux",          "ASRC1 TX1",    "ASRC1 TX1 XBAR-RX" },  \
+       { name " Mux",          "ASRC1 TX2",    "ASRC1 TX2 XBAR-RX" },  \
+       { name " Mux",          "ASRC1 TX3",    "ASRC1 TX3 XBAR-RX" },  \
+       { name " Mux",          "ASRC1 TX4",    "ASRC1 TX4 XBAR-RX" },  \
+       { 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)
@@ -1135,6 +1208,13 @@ static const struct snd_soc_dapm_route tegra186_ahub_routes[] = {
        TEGRA186_MUX_ROUTES("MIXER1 RX8")
        TEGRA186_MUX_ROUTES("MIXER1 RX9")
        TEGRA186_MUX_ROUTES("MIXER1 RX10")
+       TEGRA186_MUX_ROUTES("ASRC1 RX1")
+       TEGRA186_MUX_ROUTES("ASRC1 RX2")
+       TEGRA186_MUX_ROUTES("ASRC1 RX3")
+       TEGRA186_MUX_ROUTES("ASRC1 RX4")
+       TEGRA186_MUX_ROUTES("ASRC1 RX5")
+       TEGRA186_MUX_ROUTES("ASRC1 RX6")
+       TEGRA186_MUX_ROUTES("ASRC1 RX7")
 };
 
 static const struct snd_soc_component_driver tegra210_ahub_component = {