Commit 6fb8b02b authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Mark Brown

ASoC: Intel: Allow byt-5640 machine driver and SST core go to suspend

Since there is no support for compressed audio in Baytrail ADSP firmware
there is no need to leave it on during suspend since ALSA PCM buffers are
too small for leaving ADSP on for playing or recording.

Implement PM callbacks to Baytrail byt-rt5640.c machine driver that call
snd_soc_suspend and snd_soc_resume functions and unset the ignore_suspend
fields in DAI links.

This makes soc-core and ALSA core gracefully suspend and resume active
stream and call sst_byt_pcm_trigger() during suspend-resume cycle.
Signed-off-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent af94aa55
...@@ -124,7 +124,6 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = { ...@@ -124,7 +124,6 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBS_CFS, SND_SOC_DAIFMT_CBS_CFS,
.init = byt_rt5640_init, .init = byt_rt5640_init,
.ignore_suspend = 1,
.ops = &byt_rt5640_ops, .ops = &byt_rt5640_ops,
}, },
{ {
...@@ -137,7 +136,6 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = { ...@@ -137,7 +136,6 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBS_CFS, SND_SOC_DAIFMT_CBS_CFS,
.init = NULL, .init = NULL,
.ignore_suspend = 1,
.ops = &byt_rt5640_ops, .ops = &byt_rt5640_ops,
}, },
}; };
...@@ -152,6 +150,17 @@ static struct snd_soc_card byt_rt5640_card = { ...@@ -152,6 +150,17 @@ static struct snd_soc_card byt_rt5640_card = {
.num_dapm_routes = ARRAY_SIZE(byt_rt5640_audio_map), .num_dapm_routes = ARRAY_SIZE(byt_rt5640_audio_map),
}; };
#ifdef CONFIG_PM_SLEEP
static const struct dev_pm_ops byt_rt5640_pm_ops = {
.suspend = snd_soc_suspend,
.resume = snd_soc_resume,
};
#define BYT_RT5640_PM_OPS (&byt_rt5640_pm_ops)
#else
#define BYT_RT5640_PM_OPS NULL
#endif
static int byt_rt5640_probe(struct platform_device *pdev) static int byt_rt5640_probe(struct platform_device *pdev)
{ {
struct snd_soc_card *card = &byt_rt5640_card; struct snd_soc_card *card = &byt_rt5640_card;
...@@ -177,6 +186,7 @@ static struct platform_driver byt_rt5640_audio = { ...@@ -177,6 +186,7 @@ static struct platform_driver byt_rt5640_audio = {
.driver = { .driver = {
.name = "byt-rt5640", .name = "byt-rt5640",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = BYT_RT5640_PM_OPS,
}, },
}; };
module_platform_driver(byt_rt5640_audio) module_platform_driver(byt_rt5640_audio)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment