summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_asrc_m2m.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2017-06-12 15:19:42 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:48:27 +0800
commite265086e8f91b13d8bb8d63759548a6e51a56216 (patch)
tree2006e87c83bbb6189ac698e703e094599571570a /sound/soc/fsl/fsl_asrc_m2m.c
parentce70583b4fd2dd862bf8a21357994db72e34661f (diff)
MLK-15061-2: ASoC: fsl_asrc_m2m: fix asrc m2m can't work in imx8
Power domain need to be enabled when asrc m2m start to work, and disabled when it stop. Switch back to use the pm_runtime_get_sync and pm_runtime_put_sync for which is removed in commit 1a3d82e08fa2 ("ASoC: fsl: refine the asrc driver for imx8qm"). Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Diffstat (limited to 'sound/soc/fsl/fsl_asrc_m2m.c')
-rw-r--r--sound/soc/fsl/fsl_asrc_m2m.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
index 201b307d8a9c..3e5431eec7d9 100644
--- a/sound/soc/fsl/fsl_asrc_m2m.c
+++ b/sound/soc/fsl/fsl_asrc_m2m.c
@@ -811,7 +811,6 @@ static int fsl_asrc_open(struct inode *inode, struct file *file)
struct fsl_asrc_pair *pair;
struct fsl_asrc_m2m *m2m;
int ret;
- int i;
ret = signal_pending(current);
if (ret) {
@@ -839,11 +838,7 @@ static int fsl_asrc_open(struct inode *inode, struct file *file)
file->private_data = pair;
- clk_prepare_enable(asrc_priv->mem_clk);
- clk_prepare_enable(asrc_priv->ipg_clk);
- clk_prepare_enable(asrc_priv->spba_clk);
- for (i = 0; i < ASRC_CLK_MAX_NUM; i++)
- clk_prepare_enable(asrc_priv->asrck_clk[i]);
+ pm_runtime_get_sync(dev);
return 0;
out:
@@ -857,8 +852,8 @@ static int fsl_asrc_close(struct inode *inode, struct file *file)
struct fsl_asrc_pair *pair = file->private_data;
struct fsl_asrc_m2m *m2m = pair->private;
struct fsl_asrc *asrc_priv = pair->asrc_priv;
+ struct device *dev = &asrc_priv->pdev->dev;
unsigned long lock_flags;
- int i;
if (m2m->asrc_active) {
m2m->asrc_active = 0;
@@ -894,11 +889,7 @@ static int fsl_asrc_close(struct inode *inode, struct file *file)
spin_unlock_irqrestore(&asrc_priv->lock, lock_flags);
file->private_data = NULL;
- for (i = 0; i < ASRC_CLK_MAX_NUM; i++)
- clk_disable_unprepare(asrc_priv->asrck_clk[i]);
- clk_disable_unprepare(asrc_priv->spba_clk);
- clk_disable_unprepare(asrc_priv->ipg_clk);
- clk_disable_unprepare(asrc_priv->mem_clk);
+ pm_runtime_put_sync(dev);
return 0;
}