summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_dsp.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2019-01-30 14:58:57 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:52:17 +0800
commit87850fce9591db72709ec8acee100a79b843d083 (patch)
treed26bb711625b9d8b6d9756bf349ef2587dc41480 /sound/soc/fsl/fsl_dsp.c
parentbadc4f7be2f879be7abf28f093c18e987d42151f (diff)
ASoC: fsl_dsp: support multi power domain
support multi power domain Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Diffstat (limited to 'sound/soc/fsl/fsl_dsp.c')
-rw-r--r--sound/soc/fsl/fsl_dsp.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_dsp.c b/sound/soc/fsl/fsl_dsp.c
index aa49eb694d71..fa6e2478714a 100644
--- a/sound/soc/fsl/fsl_dsp.c
+++ b/sound/soc/fsl/fsl_dsp.c
@@ -52,6 +52,7 @@
#include <linux/miscdevice.h>
#include <linux/fs.h>
#include <linux/pm_runtime.h>
+#include <linux/pm_domain.h>
#include <linux/mx8_mu.h>
#include <linux/uaccess.h>
#include <linux/poll.h>
@@ -783,6 +784,7 @@ static int fsl_dsp_probe(struct platform_device *pdev)
dma_addr_t buf_phys;
int size, offset, i;
int ret;
+ int num_domains = 0;
char tmp[16];
dsp_priv = devm_kzalloc(&pdev->dev, sizeof(*dsp_priv), GFP_KERNEL);
@@ -816,6 +818,24 @@ static int fsl_dsp_probe(struct platform_device *pdev)
return ret;
};
+ num_domains = of_count_phandle_with_args(np, "power-domains",
+ "#power-domain-cells");
+ for (i = 0; i < num_domains; i++) {
+ struct device *pd_dev;
+ struct device_link *link;
+
+ pd_dev = dev_pm_domain_attach_by_id(&pdev->dev, i);
+ if (IS_ERR(pd_dev))
+ return PTR_ERR(pd_dev);
+
+ link = device_link_add(&pdev->dev, pd_dev,
+ DL_FLAG_STATELESS |
+ DL_FLAG_PM_RUNTIME |
+ DL_FLAG_RPM_ACTIVE);
+ if (IS_ERR(link))
+ return PTR_ERR(link);
+ }
+
if (dsp_priv->dsp_board_type == DSP_IMX8QXP_TYPE) {
ret = imx_sc_misc_set_control(dsp_priv->dsp_ipcHandle, IMX_SC_R_DSP,
IMX_SC_C_OFS_SEL, 1);