From 3ef3ff7ab857d56123bcf5dc6ce73a021cf48f45 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 5 Mar 2018 13:50:49 +0000 Subject: [PATCH] ASoC: tegra-alt: Add support for supermodule on Galen/Rey Add support for the E2614 supermodule on the Tegra194 Galen and Rey platforms. Note that on Galen and Rey, because the 'aud_mclk' is not available on the 40-pin header and the clock available on the 40-pin header, 'extperiph4', cannot generate the frequencies needed for the various sampling rates supported, we use the I2S bit-clock to drive the RT565x codec PLL. Hence, the name of the DAI link for the codec is 'rt565x-codec-sysclk-bclk1' to indicate that we need to configure the codec to use BCLK1 to drive the codec's internal PLL. Bug 2101552 Change-Id: Idd3acb6b3276e5598365ec5e655e75afc3e0bbde Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/1670425 Reviewed-by: Sameer Pujar Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu Reviewed-by: mobile promotions Tested-by: mobile promotions --- .../tegra_machine_driver_mobile.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c index 8da3a2ef..8ab9197e 100644 --- a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c +++ b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c @@ -814,6 +814,23 @@ static int tegra_machine_dai_init(struct snd_soc_pcm_runtime *runtime, } } + rtd = snd_soc_get_pcm_runtime(card, "rt565x-codec-sysclk-bclk1"); + if (rtd) { + dai_params = + (struct snd_soc_pcm_stream *)rtd->dai_link->params; + + dai_params->rate_min = clk_rate; + dai_params->formats = (machine->fmt_via_kcontrol == 2) ? + (1ULL << SNDRV_PCM_FORMAT_S32_LE) : formats; + + err = rt565x_manage_codec_sysclk(dai_params, rtd->codec_dai, + RT5659_PLL1_S_BCLK1); + if (err < 0) { + dev_err(card->dev, "codec_dai clock not set\n"); + return err; + } + } + /* TODO: remove below spdif links if clk_rate is passed * in tegra_machine_set_params */