Merge branch 'topic/fsl-mega-fast' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorMark Brown <broonie@kernel.org>
Mon, 26 Oct 2015 02:07:40 +0000 (11:07 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 26 Oct 2015 02:07:40 +0000 (11:07 +0900)
1  2 
sound/soc/fsl/fsl_sai.c

index 2150f5aaba7a4cc554d99fbe7f7e9109e79e33c2,5c737f167c5d3f06d8541569bda831a9d9b382af..38505f32ebe6069a9772954ddb9c2e3610254a6c
@@@ -801,8 -804,36 +804,37 @@@ static const struct of_device_id fsl_sa
        { .compatible = "fsl,imx6sx-sai", },
        { /* sentinel */ }
  };
 +MODULE_DEVICE_TABLE(of, fsl_sai_ids);
  
+ #if CONFIG_PM_SLEEP
+ static int fsl_sai_suspend(struct device *dev)
+ {
+       struct fsl_sai *sai = dev_get_drvdata(dev);
+       regcache_cache_only(sai->regmap, true);
+       regcache_mark_dirty(sai->regmap);
+       return 0;
+ }
+ static int fsl_sai_resume(struct device *dev)
+ {
+       struct fsl_sai *sai = dev_get_drvdata(dev);
+       regcache_cache_only(sai->regmap, false);
+       regmap_write(sai->regmap, FSL_SAI_TCSR, FSL_SAI_CSR_SR);
+       regmap_write(sai->regmap, FSL_SAI_RCSR, FSL_SAI_CSR_SR);
+       msleep(1);
+       regmap_write(sai->regmap, FSL_SAI_TCSR, 0);
+       regmap_write(sai->regmap, FSL_SAI_RCSR, 0);
+       return regcache_sync(sai->regmap);
+ }
+ #endif /* CONFIG_PM_SLEEP */
+ static const struct dev_pm_ops fsl_sai_pm_ops = {
+       SET_SYSTEM_SLEEP_PM_OPS(fsl_sai_suspend, fsl_sai_resume)
+ };
  static struct platform_driver fsl_sai_driver = {
        .probe = fsl_sai_probe,
        .driver = {