[patch] add aux_dev support to tegra_asoc_machine

Small patch to tegra_asoc_machine.c to add support for specifying nvidia-audio-card,aux-devs in device tree.

This allows using e.g. simple-audio-amplifier driver with nvidia-audio-card.

patch:

diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c
index ff2100a7ceeb..c860b1278914 100644
--- a/sound/soc/tegra/tegra_asoc_machine.c
+++ b/sound/soc/tegra/tegra_asoc_machine.c
@@ -571,6 +571,10 @@ int parse_card_info(struct snd_soc_card *card, struct snd_soc_ops *pcm_ops,
        if (ret < 0)
                return ret;

+    ret = snd_soc_of_parse_aux_devs(card, PREFIX "aux-devs");
+       if (ret < 0)
+               return ret;
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(parse_card_info);

sample use:

       tpa3116: analog-amplifier {
               compatible = "simple-audio-amplifier";
               VCC-supply = <&battery_reg>;
               enable-gpios = AMP_ENABLE_GPIO;
               sound-name-prefix = "AMP";
               status = "okay";
       };
       ...
              nvidia-audio-card,routing =
                       // DAC output to horn amplifier
                       "AMP INL",   "z LOL",
                       "AMP INR",   "z LOR",
                       // horn amplifier to speaker
                       "z Speaker", "AMP OUTL",
                       "z Speaker", "AMP OUTR";

               // link horn amplifier to this sound card
               nvidia-audio-card,aux-devs = <&tpa3116>;

The amplifier enable GPIO will now be set by dapm during audio playback.

Hi,
Thanks for sharing the patch. Will check with team.

And do you use Jetpack 4 or 5? Would like to know the patch is for kernel 4.9 or 5.10.

It is for Jetpack 5 / 5.10.104-l4t-r35.1

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.