diff options
author | Jeeja KP <jeeja.kp@intel.com> | 2016-06-13 08:29:04 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-06-14 09:59:33 -0400 |
commit | 3513798ca4bceae7cb66a7f430160f60f788cede (patch) | |
tree | 9ff2020242f910fda395f5035cd0c9e6183d2c2b /sound/soc/intel/boards | |
parent | 2f74053bead3f47ddee219f521562db941ce0ae1 (diff) |
ASoC: Intel: Add support for PM ops in bxt-rt298
We need card to be early suspended and late resumed, so use prepare and
complete for card suspend and resume.
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards')
-rw-r--r-- | sound/soc/intel/boards/bxt_rt298.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sound/soc/intel/boards/bxt_rt298.c b/sound/soc/intel/boards/bxt_rt298.c index 8b956500414b..2ef33b113bb5 100644 --- a/sound/soc/intel/boards/bxt_rt298.c +++ b/sound/soc/intel/boards/bxt_rt298.c | |||
@@ -454,10 +454,33 @@ static int broxton_audio_probe(struct platform_device *pdev) | |||
454 | return devm_snd_soc_register_card(&pdev->dev, &broxton_rt298); | 454 | return devm_snd_soc_register_card(&pdev->dev, &broxton_rt298); |
455 | } | 455 | } |
456 | 456 | ||
457 | /* | ||
458 | * we want the card to be suspend first and then platform driver. This | ||
459 | * allows the DAPM to tear down pipelines on suspend and then platform shuts | ||
460 | * down the DSP. For this use .prepare for suspending card | ||
461 | * | ||
462 | * Similarly, use complete to let DSP download firmware first and then sync | ||
463 | * DAPM and restore pipelines to DSP | ||
464 | */ | ||
465 | static void broxton_rt298_complete(struct device *dev) | ||
466 | { | ||
467 | snd_soc_resume(dev); | ||
468 | } | ||
469 | |||
470 | static const struct dev_pm_ops broxton_pm_ops = { | ||
471 | .prepare = snd_soc_suspend, | ||
472 | .complete = broxton_rt298_complete, | ||
473 | .freeze = snd_soc_suspend, | ||
474 | .thaw = snd_soc_resume, | ||
475 | .poweroff = snd_soc_poweroff, | ||
476 | .restore = snd_soc_resume, | ||
477 | }; | ||
478 | |||
457 | static struct platform_driver broxton_audio = { | 479 | static struct platform_driver broxton_audio = { |
458 | .probe = broxton_audio_probe, | 480 | .probe = broxton_audio_probe, |
459 | .driver = { | 481 | .driver = { |
460 | .name = "bxt_alc298s_i2s", | 482 | .name = "bxt_alc298s_i2s", |
483 | .pm = &broxton_pm_ops, | ||
461 | }, | 484 | }, |
462 | }; | 485 | }; |
463 | module_platform_driver(broxton_audio) | 486 | module_platform_driver(broxton_audio) |