From 38e29e8c9fbba0edbf0fd65cbfa2a7a69387934b Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Wed, 31 May 2017 11:04:52 +0800 Subject: MLK-14989: ASoC: fsl_rpmsg_i2s: enable pm_qos for audio with "echo 1 > /sys/class/graphics/fb0/blank", and there is no usb connected on board, the system may enter low power mode, then audio playback will be failed. use pm_qos to prevent A7 core enter low power mode during audio playback and recording. Signed-off-by: Shengjiu Wang (cherry picked from commit ea80731e828695bcfbf0d20c966813c3bdddfb88) --- sound/soc/fsl/fsl_rpmsg_i2s.c | 6 ++++++ sound/soc/fsl/fsl_rpmsg_i2s.h | 1 + 2 files changed, 7 insertions(+) (limited to 'sound') diff --git a/sound/soc/fsl/fsl_rpmsg_i2s.c b/sound/soc/fsl/fsl_rpmsg_i2s.c index 5a66e9097e43..3cfa3e9e50e2 100644 --- a/sound/soc/fsl/fsl_rpmsg_i2s.c +++ b/sound/soc/fsl/fsl_rpmsg_i2s.c @@ -178,11 +178,17 @@ static int fsl_rpmsg_i2s_remove(struct platform_device *pdev) #ifdef CONFIG_PM static int fsl_rpmsg_i2s_runtime_resume(struct device *dev) { + struct fsl_rpmsg_i2s *rpmsg_i2s = dev_get_drvdata(dev); + + pm_qos_add_request(&rpmsg_i2s->pm_qos_req, PM_QOS_CPU_DMA_LATENCY, 0); return 0; } static int fsl_rpmsg_i2s_runtime_suspend(struct device *dev) { + struct fsl_rpmsg_i2s *rpmsg_i2s = dev_get_drvdata(dev); + + pm_qos_remove_request(&rpmsg_i2s->pm_qos_req); return 0; } #endif diff --git a/sound/soc/fsl/fsl_rpmsg_i2s.h b/sound/soc/fsl/fsl_rpmsg_i2s.h index 259cb632630f..be951e91df29 100644 --- a/sound/soc/fsl/fsl_rpmsg_i2s.h +++ b/sound/soc/fsl/fsl_rpmsg_i2s.h @@ -309,6 +309,7 @@ struct i2s_info { struct fsl_rpmsg_i2s { struct platform_device *pdev; struct i2s_info i2s_info; + struct pm_qos_request pm_qos_req; }; #endif /* __FSL_RPMSG_I2S_H */ -- cgit v1.2.3