diff options
-rw-r--r-- | sound/soc/tegra/tegra_max98088.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra_max98088.c b/sound/soc/tegra/tegra_max98088.c index 5787d3b1d833..e4cc69d1a86a 100644 --- a/sound/soc/tegra/tegra_max98088.c +++ b/sound/soc/tegra/tegra_max98088.c @@ -91,6 +91,7 @@ struct tegra_max98088 { #ifndef CONFIG_ARCH_TEGRA_2x_SOC struct codec_config codec_info[NUM_I2S_DEVICES]; #endif + enum snd_soc_bias_level bias_level; }; static int tegra_call_mode_info(struct snd_kcontrol *kcontrol, @@ -936,10 +937,48 @@ static struct snd_soc_dai_link tegra_max98088_dai[NUM_DAI_LINKS] = { }, }; +#ifdef CONFIG_PM +int tegra30_soc_resume_pre(struct snd_soc_card *card) +{ + return tegra30_ahub_apbif_resume(); +} +#endif + + +static int tegra30_soc_set_bias_level(struct snd_soc_card *card, + enum snd_soc_bias_level level) +{ + struct tegra_max98088 *machine = snd_soc_card_get_drvdata(card); + + if (machine->bias_level == SND_SOC_BIAS_OFF && + level != SND_SOC_BIAS_OFF) + tegra_asoc_utils_clk_enable(&machine->util_data); + + machine->bias_level = level; + + return 0; +} + +static int tegra30_soc_set_bias_level_post(struct snd_soc_card *card, + enum snd_soc_bias_level level) +{ + struct tegra_max98088 *machine = snd_soc_card_get_drvdata(card); + + if (level == SND_SOC_BIAS_OFF) + tegra_asoc_utils_clk_disable(&machine->util_data); + + return 0 ; +} + static struct snd_soc_card snd_soc_tegra_max98088 = { .name = "tegra-max98088", .dai_link = tegra_max98088_dai, .num_links = ARRAY_SIZE(tegra_max98088_dai), +#ifdef CONFIG_PM + .resume_pre = tegra30_soc_resume_pre, +#endif + .set_bias_level = tegra30_soc_set_bias_level, + .set_bias_level_post = tegra30_soc_set_bias_level_post, }; static __devinit int tegra_max98088_driver_probe(struct platform_device *pdev) |