linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Shengjiu Wang <shengjiu.wang@nxp.com>
To: hverkuil@xs4all.nl, sakari.ailus@iki.fi, 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: [RFC PATCH v2 6/7] ASoC: fsl_asrc: register m2m platform device
Date: Tue, 25 Jul 2023 14:12:19 +0800	[thread overview]
Message-ID: <1690265540-25999-7-git-send-email-shengjiu.wang@nxp.com> (raw)
In-Reply-To: <1690265540-25999-1-git-send-email-shengjiu.wang@nxp.com>

Register m2m platform device, that user can
use M2M feature.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 include/sound/fsl_asrc_common.h |  2 ++
 sound/soc/fsl/fsl_asrc.c        | 12 ++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/include/sound/fsl_asrc_common.h b/include/sound/fsl_asrc_common.h
index 191302711ea6..0f3effa42308 100644
--- a/include/sound/fsl_asrc_common.h
+++ b/include/sound/fsl_asrc_common.h
@@ -69,6 +69,7 @@ struct fsl_asrc_pair {
  * @dma_params_rx: DMA parameters for receive channel
  * @dma_params_tx: DMA parameters for transmit channel
  * @pdev: platform device pointer
+ * @m2m_pdev: m2m platform device pointer
  * @regmap: regmap handler
  * @paddr: physical address to the base address of registers
  * @mem_clk: clock source to access register
@@ -102,6 +103,7 @@ struct fsl_asrc {
 	struct snd_dmaengine_dai_dma_data dma_params_rx;
 	struct snd_dmaengine_dai_dma_data dma_params_tx;
 	struct platform_device *pdev;
+	struct platform_device *m2m_pdev;
 	struct regmap *regmap;
 	unsigned long paddr;
 	struct clk *mem_clk;
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 30190ccb74e7..0d1dfa30271e 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -1198,6 +1198,7 @@ static int fsl_asrc_runtime_suspend(struct device *dev);
 static int fsl_asrc_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
+	struct fsl_asrc_m2m_pdata m2m_pdata;
 	struct fsl_asrc_priv *asrc_priv;
 	struct fsl_asrc *asrc;
 	struct resource *res;
@@ -1380,6 +1381,12 @@ static int fsl_asrc_probe(struct platform_device *pdev)
 		goto err_pm_get_sync;
 	}
 
+	m2m_pdata.asrc = asrc;
+	asrc->m2m_pdev = platform_device_register_data(&pdev->dev,
+						       "fsl_asrc_m2m",
+						       PLATFORM_DEVID_AUTO,
+						       &m2m_pdata,
+						       sizeof(m2m_pdata));
 	return 0;
 
 err_pm_get_sync:
@@ -1392,6 +1399,11 @@ static int fsl_asrc_probe(struct platform_device *pdev)
 
 static void fsl_asrc_remove(struct platform_device *pdev)
 {
+	struct fsl_asrc *asrc = dev_get_drvdata(&pdev->dev);
+
+	if (asrc->m2m_pdev && !IS_ERR(asrc->m2m_pdev))
+		platform_device_unregister(asrc->m2m_pdev);
+
 	pm_runtime_disable(&pdev->dev);
 	if (!pm_runtime_status_suspended(&pdev->dev))
 		fsl_asrc_runtime_suspend(&pdev->dev);
-- 
2.34.1


  parent reply	other threads:[~2023-07-25  6:49 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25  6:12 [RFC PATCH v2 0/7] Add audio support in v4l2 framework Shengjiu Wang
2023-07-25  6:12 ` [RFC PATCH v2 1/7] ASoC: fsl_asrc: define functions for memory to memory usage Shengjiu Wang
2023-08-01 13:58   ` Daniel Baluta
2023-07-25  6:12 ` [RFC PATCH v2 2/7] ASoC: fsl_easrc: " Shengjiu Wang
2023-07-25  6:12 ` [RFC PATCH v2 3/7] ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound Shengjiu Wang
2023-07-25  6:12 ` [RFC PATCH v2 4/7] media: v4l2: Add audio capture and output support Shengjiu Wang
2023-07-28  7:59   ` Tomasz Figa
2023-07-28 15:24     ` Mark Brown
2023-07-31  8:05     ` Shengjiu Wang
2023-08-01  9:47     ` Shengjiu Wang
2023-08-02  7:19       ` Tomasz Figa
2023-07-25  6:12 ` [RFC PATCH v2 5/7] media: imx: fsl_asrc: Add memory to memory driver Shengjiu Wang
2023-08-01 14:15   ` Daniel Baluta
2023-07-25  6:12 ` Shengjiu Wang [this message]
2023-07-25  6:12 ` [RFC PATCH v2 7/7] ASoC: fsl_easrc: register m2m platform device Shengjiu Wang
2023-08-02  7:32 ` [RFC PATCH v2 0/7] Add audio support in v4l2 framework Hans Verkuil
2023-08-02 11:22   ` Takashi Iwai
2023-08-02 12:02     ` Shengjiu Wang
2023-08-02 12:08       ` Takashi Iwai
2023-08-02 14:41         ` Shengjiu Wang
2023-08-02 17:28           ` Mark Brown
2023-08-03 13:11             ` Shengjiu Wang
2023-08-11 11:05               ` Shengjiu Wang
2023-08-23 14:33                 ` Shengjiu Wang
2023-08-24 17:03                   ` Takashi Iwai
2023-08-24 20:21                     ` Mark Brown
2023-08-25  3:46                       ` Shengjiu Wang
2023-08-25 13:54                         ` Takashi Iwai
2023-08-25 14:15                           ` Hans Verkuil
2023-08-30  3:11                             ` Shengjiu Wang
2023-08-31 20:41                     ` Nicolas Dufresne
2023-08-02 12:09       ` Mark Brown
2023-08-02 12:28       ` Hans Verkuil
2023-08-04 12:19         ` Shengjiu Wang
2023-08-04 12:34           ` Hans Verkuil

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=1690265540-25999-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=hverkuil@xs4all.nl \
    --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=sakari.ailus@iki.fi \
    --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).