public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
From: Shengjiu Wang <shengjiu.wang@nxp.com>
To: 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, linux-sound@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, kernel@pengutronix.de,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ASoC: fsl_audmix: Add support for i.MX952 platform
Date: Fri, 16 Jan 2026 18:16:48 +0800	[thread overview]
Message-ID: <20260116101648.377952-3-shengjiu.wang@nxp.com> (raw)
In-Reply-To: <20260116101648.377952-1-shengjiu.wang@nxp.com>

Add compatible string to support AUDMIX on i.MX952

The audmix module can be bypassed so that SAI signals go directly to
external pin, which makes the SAI function independent with AUDMIX.
Add struct fsl_audmix_soc_data for this soc difference.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 include/linux/firmware/imx/sm.h |  2 ++
 sound/soc/fsl/fsl_audmix.c      | 28 ++++++++++++++++++++++++++++
 sound/soc/fsl/fsl_audmix.h      |  5 +++++
 3 files changed, 35 insertions(+)

diff --git a/include/linux/firmware/imx/sm.h b/include/linux/firmware/imx/sm.h
index a33b45027356..1e3e0fb1ef81 100644
--- a/include/linux/firmware/imx/sm.h
+++ b/include/linux/firmware/imx/sm.h
@@ -26,6 +26,8 @@
 #define SCMI_IMX94_CTRL_SAI3_MCLK	5U	/*!< WAKE SAI3 MCLK */
 #define SCMI_IMX94_CTRL_SAI4_MCLK	6U	/*!< WAKE SAI4 MCLK */
 
+#define SCMI_IMX952_CTRL_BYPASS_AUDMIX	8U	/* WAKE AUDMIX */
+
 #if IS_ENABLED(CONFIG_IMX_SCMI_MISC_DRV)
 int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val);
 int scmi_imx_misc_ctrl_set(u32 id, u32 val);
diff --git a/sound/soc/fsl/fsl_audmix.c b/sound/soc/fsl/fsl_audmix.c
index 7981d598ba13..f2187b45eeec 100644
--- a/sound/soc/fsl/fsl_audmix.c
+++ b/sound/soc/fsl/fsl_audmix.c
@@ -6,6 +6,7 @@
  */
 
 #include <linux/clk.h>
+#include <linux/firmware/imx/sm.h>
 #include <linux/module.h>
 #include <linux/of_platform.h>
 #include <linux/pm_runtime.h>
@@ -440,9 +441,22 @@ static const struct regmap_config fsl_audmix_regmap_config = {
 	.cache_type = REGCACHE_FLAT,
 };
 
+static const struct fsl_audmix_soc_data fsl_audmix_imx8qm_data = {
+	.bypass_index = -1,
+};
+
+static const struct fsl_audmix_soc_data fsl_audmix_imx952_data = {
+	.bypass_index = SCMI_IMX952_CTRL_BYPASS_AUDMIX,
+};
+
 static const struct of_device_id fsl_audmix_ids[] = {
 	{
 		.compatible = "fsl,imx8qm-audmix",
+		.data = &fsl_audmix_imx8qm_data,
+	},
+	{
+		.compatible = "fsl,imx952-audmix",
+		.data = &fsl_audmix_imx952_data,
 	},
 	{ /* sentinel */ }
 };
@@ -450,6 +464,7 @@ MODULE_DEVICE_TABLE(of, fsl_audmix_ids);
 
 static int fsl_audmix_probe(struct platform_device *pdev)
 {
+	const struct fsl_audmix_soc_data *soc_data;
 	struct device *dev = &pdev->dev;
 	struct fsl_audmix *priv;
 	void __iomem *regs;
@@ -501,6 +516,19 @@ static int fsl_audmix_probe(struct platform_device *pdev)
 		}
 	}
 
+	soc_data = of_device_get_match_data(dev);
+	if (!soc_data) {
+		dev_err(dev, "failed to match device\n");
+		goto err_disable_pm;
+	}
+
+	if (of_property_read_bool(pdev->dev.of_node, "fsl,amix-bypass") &&
+	    soc_data->bypass_index > 0) {
+		ret = scmi_imx_misc_ctrl_set(soc_data->bypass_index, 0);
+		if (ret)
+			goto err_disable_pm;
+	}
+
 	return 0;
 
 err_disable_pm:
diff --git a/sound/soc/fsl/fsl_audmix.h b/sound/soc/fsl/fsl_audmix.h
index 479f05695d53..ad40a959873b 100644
--- a/sound/soc/fsl/fsl_audmix.h
+++ b/sound/soc/fsl/fsl_audmix.h
@@ -92,6 +92,11 @@
 #define FSL_AUDMIX_ATSTP_STPCTR_MASK	0x3FFFF
 
 #define FSL_AUDMIX_MAX_DAIS		2
+
+struct fsl_audmix_soc_data {
+	int bypass_index;
+};
+
 struct fsl_audmix {
 	struct platform_device *pdev;
 	struct regmap *regmap;
-- 
2.34.1



  parent reply	other threads:[~2026-01-16 10:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16 10:16 [PATCH 0/2] ASoC: fsl_audmix: Support the i.MX952 platform Shengjiu Wang
2026-01-16 10:16 ` [PATCH 1/2] ASoC: dt-bindings: fsl,audmix: Add support for " Shengjiu Wang
2026-01-16 15:00   ` Frank Li
2026-01-17 11:44   ` Krzysztof Kozlowski
2026-01-19  6:27     ` Shengjiu Wang
2026-01-19  7:07       ` Krzysztof Kozlowski
2026-01-19  7:31         ` Shengjiu Wang
2026-01-16 10:16 ` Shengjiu Wang [this message]
2026-01-19  6:37   ` [PATCH 2/2] ASoC: fsl_audmix: " Dan Carpenter

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=20260116101648.377952-3-shengjiu.wang@nxp.com \
    --to=shengjiu.wang@nxp.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=shengjiu.wang@gmail.com \
    --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