ASoC: tegra-alt: Add support for FE-PI audio Z V2 board

Add support for the FE-PI audio Z V2 board which includes the NXP
SGTL5000 audio codec. The FE-PI audio Z V2 board is an audio hat
for Raspberry-PI and is compatible with the Jetson 40-pin header.

Bug 1654376

Change-Id: I7b16b38acb91ac18c00cabc98c9e2dbe1eb9e94e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
(cherry picked from commit 0b303ebc3efc77b4e7a8bca1d62ef412873c336b)
Reviewed-on: https://git-master.nvidia.com/r/1779054
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2018-07-13 16:34:56 +01:00
committed by Sameer Pujar
parent a7307c2d19
commit 71e47ae39e
2 changed files with 36 additions and 3 deletions

View File

@@ -186,6 +186,7 @@ config SND_SOC_TEGRA_T210REF_MOBILE_ALT
select SND_SOC_SPDIF
select SND_SOC_RT5640
select SND_SOC_RT5659
select SND_SOC_SGTL5000
select SND_SOC_TEGRA_ASOC_MACHINE_ALT
help
Say Y or M here.
@@ -247,6 +248,7 @@ config SND_SOC_TEGRA_T186REF_MOBILE_ALT
tristate "SoC Audio support for T186Ref Mobile"
depends on SND_SOC_TEGRA_T186REF_ALT
select SND_SOC_RT5659
select SND_SOC_SGTL5000
help
Say Y or M here.

View File

@@ -32,6 +32,7 @@
#include <sound/soc.h>
#include <dt-bindings/sound/tas2552.h>
#include "rt5659.h"
#include "sgtl5000.h"
#include "tegra_asoc_utils_alt.h"
#include "tegra_asoc_machine_alt.h"
#include "tegra210_xbar_alt.h"
@@ -640,6 +641,16 @@ static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *runtime,
}
}
rtd = snd_soc_get_pcm_runtime(card, "fe-pi-audio-z-v2");
if (rtd) {
dai_params =
(struct snd_soc_pcm_stream *)rtd->dai_link->params;
dai_params->rate_min = clk_rate;
dai_params->channels_min = channels;
dai_params->formats = formats;
}
return 0;
}
@@ -782,6 +793,21 @@ static int tegra_machine_compr_set_params(struct snd_compr_stream *cstream)
}
#endif
static int tegra_machine_fepi_init(struct snd_soc_pcm_runtime *rtd)
{
struct device *dev = rtd->card->dev;
int err;
err = snd_soc_dai_set_sysclk(rtd->codec_dai, SGTL5000_SYSCLK, 12288000,
SND_SOC_CLOCK_IN);
if (err) {
dev_err(dev, "failed to set sgtl5000 sysclk!\n");
return err;
}
return 0;
}
static int tegra_machine_rt565x_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_card *card = rtd->card;
@@ -885,13 +911,18 @@ static void dai_link_setup(struct platform_device *pdev)
tegra_machine_rt565x_init;
}
} else if (strstr(tegra_machine_codec_links[i].name,
"dspk-playback-r"))
"dspk-playback-r")) {
tegra_machine_codec_links[i].init =
tegra_machine_dspk_init;
else if (strstr(tegra_machine_codec_links[i].name,
"dspk-playback-l"))
} else if (strstr(tegra_machine_codec_links[i].name,
"dspk-playback-l")) {
tegra_machine_codec_links[i].init =
tegra_machine_dspk_init;
} else if (strstr(tegra_machine_codec_links[i].name,
"fe-pi-audio-z-v2")) {
tegra_machine_codec_links[i].init =
tegra_machine_fepi_init;
}
}
}