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 v2 4/4] ASoC: fsl_sai: Add AUDMIX mode support on i.MX952
Date: Tue, 20 Jan 2026 11:52:10 +0800 [thread overview]
Message-ID: <20260120035210.1593742-5-shengjiu.wang@nxp.com> (raw)
In-Reply-To: <20260120035210.1593742-1-shengjiu.wang@nxp.com>
One of SAI interfaces is connected to AUDMIX in the i.MX952 chip, but
AUDMIX can be bypassed or not bypassed on the i.MX952 platform.
so add 'fsl,sai-amix-mode' property for this feature, with this
property present,then SAI driver will try to config the setting,
fsl,sai-amix-mode = <0> is bypass mode, fsl,sai-amix-mode = <1> is
the AUDMIX mode.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
include/linux/firmware/imx/sm.h | 2 ++
sound/soc/fsl/fsl_sai.c | 17 +++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/include/linux/firmware/imx/sm.h b/include/linux/firmware/imx/sm.h
index a33b45027356..ba5d93bd6158 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_sai.c b/sound/soc/fsl/fsl_sai.c
index 2fa14fbdfe1a..9facb7c5ee0d 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -7,6 +7,7 @@
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
+#include <linux/firmware/imx/sm.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pinctrl/consumer.h>
@@ -1429,6 +1430,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
int irq, ret, i;
int index;
u32 dmas[4];
+ u32 val;
sai = devm_kzalloc(dev, sizeof(*sai), GFP_KERNEL);
if (!sai)
@@ -1598,6 +1600,21 @@ static int fsl_sai_probe(struct platform_device *pdev)
if (ret < 0 && ret != -ENOSYS)
goto err_pm_get_sync;
+ if (of_property_present(np, "fsl,sai-amix-mode") &&
+ of_device_is_compatible(np, "fsl,imx952-sai")) {
+ ret = of_property_read_u32(np, "fsl,sai-amix-mode", &val);
+ if (ret || val > 1) {
+ dev_err_probe(dev, ret, "Invalid audmix mode\n");
+ goto err_pm_get_sync;
+ }
+
+ ret = scmi_imx_misc_ctrl_set(SCMI_IMX952_CTRL_BYPASS_AUDMIX, val);
+ if (ret) {
+ dev_err_probe(dev, ret, "Error setting audmix mode\n");
+ goto err_pm_get_sync;
+ }
+ }
+
/*
* Register platform component before registering cpu dai for there
* is not defer probe for platform component in snd_soc_add_pcm_runtime().
--
2.34.1
prev parent reply other threads:[~2026-01-20 3:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 3:52 [PATCH v2 0/4] ASoC: fsl_audmix: Support the i.MX952 platform Shengjiu Wang
2026-01-20 3:52 ` [PATCH v2 1/4] ASoC: dt-bindings: fsl,audmix: Add support for " Shengjiu Wang
2026-01-20 10:31 ` Krzysztof Kozlowski
2026-01-20 11:07 ` Shengjiu Wang
2026-01-21 7:59 ` Krzysztof Kozlowski
2026-01-21 7:59 ` Krzysztof Kozlowski
2026-01-20 3:52 ` [PATCH v2 2/4] ASoC: dt-bindings: fsl,sai: Add AUDMIX mode support on i.MX952 Shengjiu Wang
2026-01-21 8:03 ` Krzysztof Kozlowski
2026-01-21 10:47 ` Shengjiu Wang
2026-01-20 3:52 ` [PATCH v2 3/4] ASoC: fsl_audmix: Add support for i.MX952 platform Shengjiu Wang
2026-01-20 3:52 ` 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=20260120035210.1593742-5-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