[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1690265540-25999-8-git-send-email-shengjiu.wang@nxp.com>
Date: Tue, 25 Jul 2023 14:12:20 +0800
From: Shengjiu Wang <shengjiu.wang@....com>
To: hverkuil@...all.nl, sakari.ailus@....fi, 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: [RFC PATCH v2 7/7] ASoC: fsl_easrc: register m2m platform device
Register m2m platform device,that user can
use M2M feature.
Signed-off-by: Shengjiu Wang <shengjiu.wang@....com>
---
sound/soc/fsl/fsl_easrc.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c
index b735b24badc2..b5befefa8fbe 100644
--- a/sound/soc/fsl/fsl_easrc.c
+++ b/sound/soc/fsl/fsl_easrc.c
@@ -2074,6 +2074,7 @@ MODULE_DEVICE_TABLE(of, fsl_easrc_dt_ids);
static int fsl_easrc_probe(struct platform_device *pdev)
{
struct fsl_easrc_priv *easrc_priv;
+ struct fsl_asrc_m2m_pdata m2m_pdata;
struct device *dev = &pdev->dev;
struct fsl_asrc *easrc;
struct resource *res;
@@ -2190,11 +2191,23 @@ static int fsl_easrc_probe(struct platform_device *pdev)
return ret;
}
+ m2m_pdata.asrc = easrc;
+ easrc->m2m_pdev = platform_device_register_data(&pdev->dev,
+ "fsl_asrc_m2m",
+ PLATFORM_DEVID_AUTO,
+ &m2m_pdata,
+ sizeof(m2m_pdata));
+
return 0;
}
static void fsl_easrc_remove(struct platform_device *pdev)
{
+ struct fsl_asrc *easrc = dev_get_drvdata(&pdev->dev);
+
+ if (easrc->m2m_pdev && !IS_ERR(easrc->m2m_pdev))
+ platform_device_unregister(easrc->m2m_pdev);
+
pm_runtime_disable(&pdev->dev);
}
--
2.34.1
Powered by blists - more mailing lists