summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_dsp.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2020-05-09 15:50:05 +0800
committerShengjiu Wang <shengjiu.wang@nxp.com>2020-05-09 17:47:00 +0800
commitd1be673ae5c835b47cbd2222d85d23bbd6593b69 (patch)
tree014f224d7c99992ecfbbed5d0f50174e5910a86d /sound/soc/fsl/fsl_dsp.c
parent70d47b6aff5da8acc697f0a0481a5fa1e67a7551 (diff)
MLK-23958: ASoC: fsl_dsp: Fix the power issue with dsp
Need to use pm_runtime_get_sync & pm_runtime_put_sync in probe to bind the attached power domain with device. Fixes: ee1a47b87fff ("MLK-23618-6: ASoC: fsl_dsp: refine handling of multi power domain") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Peng Zhang <peng.zhang_8@nxp.com>
Diffstat (limited to 'sound/soc/fsl/fsl_dsp.c')
-rw-r--r--sound/soc/fsl/fsl_dsp.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/sound/soc/fsl/fsl_dsp.c b/sound/soc/fsl/fsl_dsp.c
index d48121b74b42..74927f8ade84 100644
--- a/sound/soc/fsl/fsl_dsp.c
+++ b/sound/soc/fsl/fsl_dsp.c
@@ -947,23 +947,6 @@ static int fsl_dsp_detach_pm_domains(struct device *dev,
return 0;
}
-/**
- * fsl_dev_put_pm_domains
- */
-static int fsl_dsp_put_pm_domains(struct device *dev,
- struct fsl_dsp *dsp)
-{
- int i;
-
- if (dsp->num_domains <= 1)
- return 0;
-
- for (i = 0; i < dsp->num_domains; i++)
- pm_runtime_put_sync(dsp->pd_dev[i]);
-
- return 0;
-}
-
static int fsl_dsp_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
@@ -1013,6 +996,12 @@ static int fsl_dsp_probe(struct platform_device *pdev)
if (ret)
return ret;
+ platform_set_drvdata(pdev, dsp_priv);
+ pm_runtime_enable(&pdev->dev);
+ dsp_priv->dsp_mu_init = 1;
+ dsp_priv->proxy.is_ready = 1;
+ pm_runtime_get_sync(&pdev->dev);
+
ret = fsl_dsp_configure(dsp_priv);
if (ret < 0)
return ret;
@@ -1021,6 +1010,10 @@ static int fsl_dsp_probe(struct platform_device *pdev)
if (ret)
return ret;
+ pm_runtime_put_sync(&pdev->dev);
+ dsp_priv->dsp_mu_init = 0;
+ dsp_priv->proxy.is_ready = 0;
+
ret = of_property_read_string(np, "fsl,dsp-firmware", &fw_name);
dsp_priv->fw_name = fw_name;
@@ -1029,10 +1022,6 @@ static int fsl_dsp_probe(struct platform_device *pdev)
ret = of_property_read_u32(np, "fixup-offset", &dsp_priv->fixup_offset);
- platform_set_drvdata(pdev, dsp_priv);
- pm_runtime_enable(&pdev->dev);
- fsl_dsp_put_pm_domains(&pdev->dev, dsp_priv);
-
dsp_miscdev.fops = &dsp_fops,
dsp_miscdev.parent = &pdev->dev,
ret = misc_register(&dsp_miscdev);