ASoC: fsl_audmix: Support the i.MX952 platform

Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

Enable AUDMIX on i.MX952 platform, update dt binding document and
driver.

SAI is connected to AUDMIX, and the AUDMIX can be bypassed, so
add 'fsl,sai-amix-mode' property in SAI binding document for this
case.
This commit is contained in:
Mark Brown 2026-01-28 00:37:45 +00:00
commit ab2e3fa491
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
6 changed files with 60 additions and 2 deletions

View File

@ -34,7 +34,9 @@ description: |
properties:
compatible:
const: fsl,imx8qm-audmix
enum:
- fsl,imx8qm-audmix
- fsl,imx952-audmix
reg:
maxItems: 1
@ -80,7 +82,17 @@ required:
- reg
- clocks
- clock-names
- power-domains
allOf:
- if:
properties:
compatible:
contains:
enum:
- fsl,imx8qm-audmix
then:
required:
- power-domains
unevaluatedProperties: false

View File

@ -132,6 +132,13 @@ properties:
- description: dataline mask for 'rx'
- description: dataline mask for 'tx'
fsl,sai-amix-mode:
$ref: /schemas/types.yaml#/definitions/string
description:
The audmix module is bypassed from hardware or not.
enum: [none, bypass, audmix]
default: none
fsl,sai-mclk-direction-output:
description: SAI will output the SAI MCLK clock.
type: boolean
@ -179,6 +186,15 @@ allOf:
properties:
fsl,sai-synchronous-rx: false
- if:
required:
- fsl,sai-amix-mode
then:
properties:
compatible:
contains:
const: fsl,imx952-sai
required:
- compatible
- reg

View File

@ -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);

View File

@ -444,6 +444,9 @@ static const struct of_device_id fsl_audmix_ids[] = {
{
.compatible = "fsl,imx8qm-audmix",
},
{
.compatible = "fsl,imx952-audmix",
},
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, fsl_audmix_ids);

View File

@ -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>
@ -1425,10 +1426,12 @@ static int fsl_sai_probe(struct platform_device *pdev)
struct fsl_sai *sai;
struct regmap *gpr;
void __iomem *base;
const char *str = NULL;
char tmp[8];
int irq, ret, i;
int index;
u32 dmas[4];
u32 val;
sai = devm_kzalloc(dev, sizeof(*sai), GFP_KERNEL);
if (!sai)
@ -1598,6 +1601,24 @@ static int fsl_sai_probe(struct platform_device *pdev)
if (ret < 0 && ret != -ENOSYS)
goto err_pm_get_sync;
if (of_device_is_compatible(np, "fsl,imx952-sai") &&
!of_property_read_string(np, "fsl,sai-amix-mode", &str)) {
if (!strcmp(str, "bypass"))
val = FSL_SAI_AMIX_BYPASS;
else if (!strcmp(str, "audmix"))
val = FSL_SAI_AMIX_AUDMIX;
else
val = FSL_SAI_AMIX_NONE;
if (val < FSL_SAI_AMIX_NONE) {
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().

View File

@ -230,6 +230,10 @@
#define FSL_SAI_DL_I2S BIT(0)
#define FSL_SAI_DL_PDM BIT(1)
#define FSL_SAI_AMIX_BYPASS 0
#define FSL_SAI_AMIX_AUDMIX 1
#define FSL_SAI_AMIX_NONE 2
struct fsl_sai_soc_data {
bool use_imx_pcm;
bool use_edma;