Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

+122 -6
+60 -1
Documentation/devicetree/bindings/sound/fsl,audmix.yaml
··· 61 61 - description: serial audio input 2 62 62 maxItems: 1 63 63 64 + ports: 65 + $ref: /schemas/graph.yaml#/properties/ports 66 + patternProperties: 67 + '^port@[0-1]': 68 + $ref: audio-graph-port.yaml# 69 + unevaluatedProperties: false 70 + description: Input port from SAI TX 71 + 72 + properties: 73 + port@2: 74 + $ref: audio-graph-port.yaml# 75 + unevaluatedProperties: false 76 + description: Output port to SAI RX 77 + 64 78 required: 65 79 - compatible 66 80 - reg 67 81 - clocks 68 82 - clock-names 69 83 - power-domains 70 - - dais 71 84 72 85 unevaluatedProperties: false 73 86 ··· 93 80 clock-names = "ipg"; 94 81 power-domains = <&pd_audmix>; 95 82 dais = <&sai4>, <&sai5>; 83 + 84 + ports { 85 + #address-cells = <1>; 86 + #size-cells = <0>; 87 + 88 + port@0 { 89 + reg = <0>; 90 + playback-only; 91 + 92 + amix_endpoint0: endpoint { 93 + dai-tdm-slot-num = <8>; 94 + dai-tdm-slot-width = <32>; 95 + dai-tdm-slot-width-map = <32 8 32>; 96 + dai-format = "dsp_a"; 97 + remote-endpoint = <&be00_ep>; 98 + }; 99 + }; 100 + 101 + port@1 { 102 + reg = <1>; 103 + playback-only; 104 + 105 + amix_endpoint1: endpoint { 106 + dai-tdm-slot-num = <8>; 107 + dai-tdm-slot-width = <32>; 108 + dai-tdm-slot-width-map = <32 8 32>; 109 + dai-format = "dsp_a"; 110 + remote-endpoint = <&be01_ep>; 111 + }; 112 + }; 113 + 114 + port@2 { 115 + reg = <2>; 116 + capture-only; 117 + 118 + amix_endpoint2: endpoint { 119 + dai-tdm-slot-num = <8>; 120 + dai-tdm-slot-width = <32>; 121 + dai-tdm-slot-width-map = <32 8 32>; 122 + dai-format = "dsp_a"; 123 + bitclock-master; 124 + frame-master; 125 + remote-endpoint = <&be02_ep>; 126 + }; 127 + }; 128 + }; 96 129 };
+51
Documentation/devicetree/bindings/sound/fsl,sai.yaml
··· 93 93 items: 94 94 - description: receive and transmit interrupt 95 95 96 + ports: 97 + $ref: /schemas/graph.yaml#/properties/ports 98 + properties: 99 + port@0: 100 + $ref: audio-graph-port.yaml# 101 + unevaluatedProperties: false 102 + description: port for TX and RX 103 + 104 + port@1: 105 + $ref: audio-graph-port.yaml# 106 + unevaluatedProperties: false 107 + description: port for TX only 108 + 109 + port@2: 110 + $ref: audio-graph-port.yaml# 111 + unevaluatedProperties: false 112 + description: port for RX only 113 + 96 114 big-endian: 97 115 description: | 98 116 required if all the SAI registers are big-endian rather than little-endian. ··· 222 204 dma-names = "rx", "tx"; 223 205 fsl,dataline = <1 0xff 0xff 2 0xff 0x11>; 224 206 #sound-dai-cells = <0>; 207 + 208 + ports { 209 + #address-cells = <1>; 210 + #size-cells = <0>; 211 + 212 + port@1 { 213 + reg = <1>; 214 + playback-only; 215 + 216 + sai1_endpoint0: endpoint { 217 + dai-tdm-slot-num = <8>; 218 + dai-tdm-slot-width = <32>; 219 + dai-tdm-slot-width-map = <32 8 32>; 220 + dai-format = "dsp_a"; 221 + bitclock-master; 222 + frame-master; 223 + remote-endpoint = <&mcodec01_ep>; 224 + }; 225 + }; 226 + 227 + port@2 { 228 + reg = <2>; 229 + capture-only; 230 + 231 + sai1_endpoint1: endpoint { 232 + dai-tdm-slot-num = <8>; 233 + dai-tdm-slot-width = <32>; 234 + dai-tdm-slot-width-map = <32 8 32>; 235 + dai-format = "dsp_a"; 236 + remote-endpoint = <&fe02_ep>; 237 + }; 238 + }; 239 + }; 225 240 };
+11 -5
sound/soc/fsl/fsl_audmix.c
··· 488 488 goto err_disable_pm; 489 489 } 490 490 491 - priv->pdev = platform_device_register_data(dev, "imx-audmix", 0, NULL, 0); 492 - if (IS_ERR(priv->pdev)) { 493 - ret = PTR_ERR(priv->pdev); 494 - dev_err(dev, "failed to register platform: %d\n", ret); 495 - goto err_disable_pm; 491 + /* 492 + * If dais property exist, then register the imx-audmix card driver. 493 + * otherwise, it should be linked by audio graph card. 494 + */ 495 + if (of_find_property(pdev->dev.of_node, "dais", NULL)) { 496 + priv->pdev = platform_device_register_data(dev, "imx-audmix", 0, NULL, 0); 497 + if (IS_ERR(priv->pdev)) { 498 + ret = PTR_ERR(priv->pdev); 499 + dev_err(dev, "failed to register platform: %d\n", ret); 500 + goto err_disable_pm; 501 + } 496 502 } 497 503 498 504 return 0;