From e265086e8f91b13d8bb8d63759548a6e51a56216 Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Mon, 12 Jun 2017 15:19:42 +0800 Subject: 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 --- sound/soc/fsl/fsl_asrc_m2m.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'sound/soc/fsl/fsl_asrc_m2m.c') 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; } -- cgit v1.2.3