imx-audmix.c (09d950723479ef0af3a317ac190a8c1fadd7343c) imx-audmix.c (09cda705860125ffee1b1359b1da79f8e0c77a40)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright 2017 NXP
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *

--- 193 unchanged lines hidden (view full) ---

202 sizeof(struct snd_soc_dapm_route),
203 GFP_KERNEL);
204 if (!priv->dapm_routes)
205 return -ENOMEM;
206
207 for (i = 0; i < num_dai; i++) {
208 struct snd_soc_dai_link_component *dlc;
209
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright 2017 NXP
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *

--- 193 unchanged lines hidden (view full) ---

202 sizeof(struct snd_soc_dapm_route),
203 GFP_KERNEL);
204 if (!priv->dapm_routes)
205 return -ENOMEM;
206
207 for (i = 0; i < num_dai; i++) {
208 struct snd_soc_dai_link_component *dlc;
209
210 /* for CPU/Codec x 2 */
211 dlc = devm_kcalloc(&pdev->dev, 4, sizeof(*dlc), GFP_KERNEL);
210 /* for CPU/Codec/Platform x 2 */
211 dlc = devm_kcalloc(&pdev->dev, 6, sizeof(*dlc), GFP_KERNEL);
212 if (!dlc)
213 return -ENOMEM;
214
215 ret = of_parse_phandle_with_args(audmix_np, "dais", NULL, i,
216 &args);
217 if (ret < 0) {
218 dev_err(&pdev->dev, "of_parse_phandle_with_args failed\n");
219 return ret;

--- 15 unchanged lines hidden (view full) ---

235 out_cpu_np = args.np;
236 capture_dai_name =
237 devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s %s",
238 dai_name, "CPU-Capture");
239 }
240
241 priv->dai[i].cpus = &dlc[0];
242 priv->dai[i].codecs = &dlc[1];
212 if (!dlc)
213 return -ENOMEM;
214
215 ret = of_parse_phandle_with_args(audmix_np, "dais", NULL, i,
216 &args);
217 if (ret < 0) {
218 dev_err(&pdev->dev, "of_parse_phandle_with_args failed\n");
219 return ret;

--- 15 unchanged lines hidden (view full) ---

235 out_cpu_np = args.np;
236 capture_dai_name =
237 devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s %s",
238 dai_name, "CPU-Capture");
239 }
240
241 priv->dai[i].cpus = &dlc[0];
242 priv->dai[i].codecs = &dlc[1];
243 priv->dai[i].platforms = &dlc[2];
243
244 priv->dai[i].num_cpus = 1;
245 priv->dai[i].num_codecs = 1;
244
245 priv->dai[i].num_cpus = 1;
246 priv->dai[i].num_codecs = 1;
247 priv->dai[i].num_platforms = 1;
246
247 priv->dai[i].name = dai_name;
248 priv->dai[i].stream_name = "HiFi-AUDMIX-FE";
249 priv->dai[i].codecs->dai_name = "snd-soc-dummy-dai";
250 priv->dai[i].codecs->name = "snd-soc-dummy";
251 priv->dai[i].cpus->of_node = args.np;
252 priv->dai[i].cpus->dai_name = dev_name(&cpu_pdev->dev);
248
249 priv->dai[i].name = dai_name;
250 priv->dai[i].stream_name = "HiFi-AUDMIX-FE";
251 priv->dai[i].codecs->dai_name = "snd-soc-dummy-dai";
252 priv->dai[i].codecs->name = "snd-soc-dummy";
253 priv->dai[i].cpus->of_node = args.np;
254 priv->dai[i].cpus->dai_name = dev_name(&cpu_pdev->dev);
255 priv->dai[i].platforms->of_node = args.np;
253 priv->dai[i].dynamic = 1;
254 priv->dai[i].dpcm_playback = 1;
255 priv->dai[i].dpcm_capture = (i == 0 ? 1 : 0);
256 priv->dai[i].ignore_pmdown_time = 1;
257 priv->dai[i].ops = &imx_audmix_fe_ops;
258
259 /* Add AUDMIX Backend */
260 be_name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
261 "audmix-%d", i);
262 be_pb = devm_kasprintf(&pdev->dev, GFP_KERNEL,
263 "AUDMIX-Playback-%d", i);
264 be_cp = devm_kasprintf(&pdev->dev, GFP_KERNEL,
265 "AUDMIX-Capture-%d", i);
266
256 priv->dai[i].dynamic = 1;
257 priv->dai[i].dpcm_playback = 1;
258 priv->dai[i].dpcm_capture = (i == 0 ? 1 : 0);
259 priv->dai[i].ignore_pmdown_time = 1;
260 priv->dai[i].ops = &imx_audmix_fe_ops;
261
262 /* Add AUDMIX Backend */
263 be_name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
264 "audmix-%d", i);
265 be_pb = devm_kasprintf(&pdev->dev, GFP_KERNEL,
266 "AUDMIX-Playback-%d", i);
267 be_cp = devm_kasprintf(&pdev->dev, GFP_KERNEL,
268 "AUDMIX-Capture-%d", i);
269
267 priv->dai[num_dai + i].cpus = &dlc[2];
268 priv->dai[num_dai + i].codecs = &dlc[3];
270 priv->dai[num_dai + i].cpus = &dlc[3];
271 priv->dai[num_dai + i].codecs = &dlc[4];
272 priv->dai[num_dai + i].platforms = &dlc[5];
269
270 priv->dai[num_dai + i].num_cpus = 1;
271 priv->dai[num_dai + i].num_codecs = 1;
273
274 priv->dai[num_dai + i].num_cpus = 1;
275 priv->dai[num_dai + i].num_codecs = 1;
276 priv->dai[num_dai + i].num_platforms = 1;
272
273 priv->dai[num_dai + i].name = be_name;
274 priv->dai[num_dai + i].codecs->dai_name = "snd-soc-dummy-dai";
275 priv->dai[num_dai + i].codecs->name = "snd-soc-dummy";
276 priv->dai[num_dai + i].cpus->of_node = audmix_np;
277 priv->dai[num_dai + i].cpus->dai_name = be_name;
277
278 priv->dai[num_dai + i].name = be_name;
279 priv->dai[num_dai + i].codecs->dai_name = "snd-soc-dummy-dai";
280 priv->dai[num_dai + i].codecs->name = "snd-soc-dummy";
281 priv->dai[num_dai + i].cpus->of_node = audmix_np;
282 priv->dai[num_dai + i].cpus->dai_name = be_name;
283 priv->dai[num_dai + i].platforms->name = "snd-soc-dummy";
278 priv->dai[num_dai + i].no_pcm = 1;
279 priv->dai[num_dai + i].dpcm_playback = 1;
280 priv->dai[num_dai + i].dpcm_capture = 1;
281 priv->dai[num_dai + i].ignore_pmdown_time = 1;
282 priv->dai[num_dai + i].ops = &imx_audmix_be_ops;
283
284 priv->dai_conf[i].dlc.of_node = args.np;
285 priv->dai_conf[i].name_prefix = dai_name;

--- 63 unchanged lines hidden ---
284 priv->dai[num_dai + i].no_pcm = 1;
285 priv->dai[num_dai + i].dpcm_playback = 1;
286 priv->dai[num_dai + i].dpcm_capture = 1;
287 priv->dai[num_dai + i].ignore_pmdown_time = 1;
288 priv->dai[num_dai + i].ops = &imx_audmix_be_ops;
289
290 priv->dai_conf[i].dlc.of_node = args.np;
291 priv->dai_conf[i].name_prefix = dai_name;

--- 63 unchanged lines hidden ---