summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2019-11-22 15:45:33 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:54:27 +0800
commitf25a2423464bfb3e352c6a898f9e51e1e31895d1 (patch)
tree066fc94780a172c45836243b439caf4597b13135 /sound/soc
parent24a3bee2e17b29cbeb0517a86e8822c5e1ac0884 (diff)
LF-106: ASoC: fsl_ssi: request BUS_FREQ_AUDIO
request BUS_FREQ_AUDIO Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/fsl/fsl_ssi.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 88baaf3f7a45..c3c760067b50 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -40,6 +40,8 @@
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
+#include <linux/pm_runtime.h>
+#include <linux/busfreq-imx.h>
#include <sound/core.h>
#include <sound/pcm.h>
@@ -1572,6 +1574,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
}
dev_set_drvdata(dev, ssi);
+ pm_runtime_enable(&pdev->dev);
if (ssi->soc->imx) {
ret = fsl_ssi_imx_probe(pdev, ssi, iomem);
@@ -1671,6 +1674,20 @@ static int fsl_ssi_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_PM
+static int fsl_ssi_runtime_resume(struct device *dev)
+{
+ request_bus_freq(BUS_FREQ_AUDIO);
+ return 0;
+}
+
+static int fsl_ssi_runtime_suspend(struct device *dev)
+{
+ release_bus_freq(BUS_FREQ_AUDIO);
+ return 0;
+}
+#endif
+
#ifdef CONFIG_PM_SLEEP
static int fsl_ssi_suspend(struct device *dev)
{
@@ -1705,6 +1722,8 @@ static int fsl_ssi_resume(struct device *dev)
static const struct dev_pm_ops fsl_ssi_pm = {
SET_SYSTEM_SLEEP_PM_OPS(fsl_ssi_suspend, fsl_ssi_resume)
+ SET_RUNTIME_PM_OPS(fsl_ssi_runtime_suspend, fsl_ssi_runtime_resume,
+ NULL)
};
static struct platform_driver fsl_ssi_driver = {