ASoC: Machine: ignore suspend for dai-links

This patch is being added for Android to avoid high suspend latency
resulting from commit bedf87fbcd537a5cc7b5d972c34a92cce9414f93. For
android, system cannot go to suspend when audio playback is running.
Thus issue mentioned in above commit is not applicable to Android.
CONFIG_ANDROID is used to selectively ignore suspend.

Bug 2061442

Change-Id: Id536920cb857e6d7a614d2a742012e17eac5f14f
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1659720
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Sameer Pujar
2018-02-16 09:54:27 +05:30
parent f3b86672a3
commit 9189bb6b72

View File

@@ -105,6 +105,7 @@ struct tegra_machine_soc_data {
static int tegra_machine_driver_remove(struct platform_device *);
static int tegra_machine_driver_probe(struct platform_device *);
static void dai_link_setup(struct platform_device *);
static void ignore_suspend(struct snd_soc_card *);
static int tegra_machine_sfc_init(struct snd_soc_pcm_runtime *);
static int tegra_machine_ext_codec_init(struct snd_soc_pcm_runtime *);
@@ -1215,6 +1216,24 @@ static const struct of_device_id tegra_machine_of_match[] = {
{},
};
static void __maybe_unused ignore_suspend(struct snd_soc_card *card)
{
struct snd_soc_pcm_runtime *rtd;
#if KERNEL_VERSION(4, 5, 0) > LINUX_VERSION_CODE
struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
int idx;
int num_of_dai_links = machine->soc_data->num_xbar_dai_links +
machine->num_codec_links;
for (idx = 0; idx < num_of_dai_links; idx++) {
rtd = &card->rtd[idx];
#else
list_for_each_entry(rtd, &card->rtd_list, list) {
#endif
rtd->dai_link->ignore_suspend = true;
}
}
static int tegra_machine_driver_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
@@ -1344,6 +1363,10 @@ static int tegra_machine_driver_probe(struct platform_device *pdev)
goto err_switch_unregister;
}
#ifdef CONFIG_ANDROID
ignore_suspend(card);
#endif
rtd = tegra_machine_get_codec_link(card);
if (!rtd)
dev_warn(&pdev->dev,