[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1688002673-28493-7-git-send-email-shengjiu.wang@nxp.com>
Date: Thu, 29 Jun 2023 09:37:53 +0800
From: Shengjiu Wang <shengjiu.wang@....com>
To: tfiga@...omium.org, m.szyprowski@...sung.com, mchehab@...nel.org,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
shengjiu.wang@...il.com, Xiubo.Lee@...il.com, festevam@...il.com,
nicoleotsuka@...il.com, lgirdwood@...il.com, broonie@...nel.org,
perex@...ex.cz, tiwai@...e.com, alsa-devel@...a-project.org,
linuxppc-dev@...ts.ozlabs.org
Subject: [PATCH 6/6] ASoC: fsl_easrc: enable memory to memory function
Intergrate memory to memory feature to EASRC driver.
call m2m probe(), remove(), suspend() and resume()
in different callback.
Signed-off-by: Shengjiu Wang <shengjiu.wang@....com>
---
sound/soc/fsl/fsl_easrc.c | 41 +++++++++++++++++++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c
index b735b24badc2..bc5404627032 100644
--- a/sound/soc/fsl/fsl_easrc.c
+++ b/sound/soc/fsl/fsl_easrc.c
@@ -29,6 +29,7 @@
#include <sound/core.h>
#include "fsl_easrc.h"
+#include "fsl_asrc_m2m.h"
#include "imx-pcm.h"
#define FSL_EASRC_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
@@ -2190,11 +2191,21 @@ static int fsl_easrc_probe(struct platform_device *pdev)
return ret;
}
+ /* probe the m2m feature */
+ ret = fsl_asrc_m2m_probe(easrc);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to init m2m device %d\n", ret);
+ return ret;
+ }
+
return 0;
}
static void fsl_easrc_remove(struct platform_device *pdev)
{
+ /* remove the m2m feature */
+ fsl_asrc_m2m_remove(pdev);
+
pm_runtime_disable(&pdev->dev);
}
@@ -2295,12 +2306,38 @@ static __maybe_unused int fsl_easrc_runtime_resume(struct device *dev)
return ret;
}
+static int __maybe_unused fsl_easrc_suspend(struct device *dev)
+{
+ struct fsl_asrc *easrc = dev_get_drvdata(dev);
+ int ret;
+
+ /* suspend m2m function first */
+ fsl_asrc_m2m_suspend(easrc);
+
+ ret = pm_runtime_force_suspend(dev);
+
+ return ret;
+}
+
+static int __maybe_unused fsl_easrc_resume(struct device *dev)
+{
+ struct fsl_asrc *easrc = dev_get_drvdata(dev);
+ int ret;
+
+ ret = pm_runtime_force_resume(dev);
+
+ /* resume m2m function */
+ fsl_asrc_m2m_resume(easrc);
+
+ return ret;
+}
+
static const struct dev_pm_ops fsl_easrc_pm_ops = {
SET_RUNTIME_PM_OPS(fsl_easrc_runtime_suspend,
fsl_easrc_runtime_resume,
NULL)
- SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
- pm_runtime_force_resume)
+ SET_SYSTEM_SLEEP_PM_OPS(fsl_easrc_suspend,
+ fsl_easrc_resume)
};
static struct platform_driver fsl_easrc_driver = {
--
2.34.1
Powered by blists - more mailing lists