ASoC: fsl_audmix: support audio graph card for audmix

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

Change 'dais' property to be optional, that fsl_audmix device can be
linked with SAI device by audio graph card.
This commit is contained in:
Mark Brown
2025-03-04 18:38:42 +00:00
3 changed files with 122 additions and 6 deletions

View File

@@ -61,13 +61,26 @@ properties:
- description: serial audio input 2
maxItems: 1
ports:
$ref: /schemas/graph.yaml#/properties/ports
patternProperties:
'^port@[0-1]':
$ref: audio-graph-port.yaml#
unevaluatedProperties: false
description: Input port from SAI TX
properties:
port@2:
$ref: audio-graph-port.yaml#
unevaluatedProperties: false
description: Output port to SAI RX
required:
- compatible
- reg
- clocks
- clock-names
- power-domains
- dais
unevaluatedProperties: false
@@ -80,4 +93,50 @@ examples:
clock-names = "ipg";
power-domains = <&pd_audmix>;
dais = <&sai4>, <&sai5>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
playback-only;
amix_endpoint0: endpoint {
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <32>;
dai-tdm-slot-width-map = <32 8 32>;
dai-format = "dsp_a";
remote-endpoint = <&be00_ep>;
};
};
port@1 {
reg = <1>;
playback-only;
amix_endpoint1: endpoint {
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <32>;
dai-tdm-slot-width-map = <32 8 32>;
dai-format = "dsp_a";
remote-endpoint = <&be01_ep>;
};
};
port@2 {
reg = <2>;
capture-only;
amix_endpoint2: endpoint {
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <32>;
dai-tdm-slot-width-map = <32 8 32>;
dai-format = "dsp_a";
bitclock-master;
frame-master;
remote-endpoint = <&be02_ep>;
};
};
};
};

View File

@@ -93,6 +93,24 @@ properties:
items:
- description: receive and transmit interrupt
ports:
$ref: /schemas/graph.yaml#/properties/ports
properties:
port@0:
$ref: audio-graph-port.yaml#
unevaluatedProperties: false
description: port for TX and RX
port@1:
$ref: audio-graph-port.yaml#
unevaluatedProperties: false
description: port for TX only
port@2:
$ref: audio-graph-port.yaml#
unevaluatedProperties: false
description: port for RX only
big-endian:
description: |
required if all the SAI registers are big-endian rather than little-endian.
@@ -204,4 +222,37 @@ examples:
dma-names = "rx", "tx";
fsl,dataline = <1 0xff 0xff 2 0xff 0x11>;
#sound-dai-cells = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@1 {
reg = <1>;
playback-only;
sai1_endpoint0: endpoint {
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <32>;
dai-tdm-slot-width-map = <32 8 32>;
dai-format = "dsp_a";
bitclock-master;
frame-master;
remote-endpoint = <&mcodec01_ep>;
};
};
port@2 {
reg = <2>;
capture-only;
sai1_endpoint1: endpoint {
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <32>;
dai-tdm-slot-width-map = <32 8 32>;
dai-format = "dsp_a";
remote-endpoint = <&fe02_ep>;
};
};
};
};

View File

@@ -488,11 +488,17 @@ static int fsl_audmix_probe(struct platform_device *pdev)
goto err_disable_pm;
}
priv->pdev = platform_device_register_data(dev, "imx-audmix", 0, NULL, 0);
if (IS_ERR(priv->pdev)) {
ret = PTR_ERR(priv->pdev);
dev_err(dev, "failed to register platform: %d\n", ret);
goto err_disable_pm;
/*
* If dais property exist, then register the imx-audmix card driver.
* otherwise, it should be linked by audio graph card.
*/
if (of_find_property(pdev->dev.of_node, "dais", NULL)) {
priv->pdev = platform_device_register_data(dev, "imx-audmix", 0, NULL, 0);
if (IS_ERR(priv->pdev)) {
ret = PTR_ERR(priv->pdev);
dev_err(dev, "failed to register platform: %d\n", ret);
goto err_disable_pm;
}
}
return 0;