From: Shengjiu Wang <shengjiu.wang@nxp.com>
To: tfiga@chromium.org, m.szyprowski@samsung.com, mchehab@kernel.org,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com,
nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org,
perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 6/6] ASoC: fsl_easrc: enable memory to memory function
Date: Thu, 29 Jun 2023 09:37:53 +0800 [thread overview]
Message-ID: <1688002673-28493-7-git-send-email-shengjiu.wang@nxp.com> (raw)
In-Reply-To: <1688002673-28493-1-git-send-email-shengjiu.wang@nxp.com>
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@nxp.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
prev parent reply other threads:[~2023-06-29 2:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-29 1:37 [PATCH 0/6] Add audio support in v4l2 framework Shengjiu Wang
2023-06-29 1:37 ` [PATCH 1/6] media: v4l2: Add audio capture and output support Shengjiu Wang
2023-06-30 10:05 ` Sakari Ailus
2023-07-03 9:54 ` Shengjiu Wang
2023-07-03 10:04 ` Hans Verkuil
2023-07-03 12:07 ` Takashi Iwai
2023-07-03 12:53 ` Mark Brown
2023-07-03 13:12 ` Hans Verkuil
2023-07-03 13:25 ` Takashi Iwai
2023-07-04 3:55 ` Shengjiu Wang
2023-07-03 17:58 ` Mark Brown
2023-07-04 4:03 ` Shengjiu Wang
2023-07-07 3:13 ` Shengjiu Wang
2023-07-19 9:15 ` Shengjiu Wang
2023-06-29 1:37 ` [PATCH 2/6] ASoC: fsl_asrc: define functions for memory to memory usage Shengjiu Wang
2023-06-29 1:37 ` [PATCH 3/6] ASoC: fsl_easrc: " Shengjiu Wang
2023-06-29 10:59 ` Fabio Estevam
2023-06-30 3:23 ` Shengjiu Wang
2023-06-29 1:37 ` [PATCH 4/6] ASoC: fsl_asrc: Add memory to memory driver Shengjiu Wang
2023-06-29 11:38 ` Mark Brown
2023-06-30 3:37 ` Shengjiu Wang
2023-06-30 11:22 ` Mark Brown
2023-06-29 1:37 ` [PATCH 5/6] ASoC: fsl_asrc: enable memory to memory function Shengjiu Wang
2023-06-29 1:37 ` Shengjiu Wang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1688002673-28493-7-git-send-email-shengjiu.wang@nxp.com \
--to=shengjiu.wang@nxp.com \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=m.szyprowski@samsung.com \
--cc=mchehab@kernel.org \
--cc=nicoleotsuka@gmail.com \
--cc=perex@perex.cz \
--cc=shengjiu.wang@gmail.com \
--cc=tfiga@chromium.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).