imx-audmix.c (1c15ca4e4efaddb78f83eed31eeee34c522c3ae2) imx-audmix.c (87e39e9b004a629f2a27497ce6c172bfcb50ed37)
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 x 2 */
211 dlc = devm_kcalloc(&pdev->dev, 2, 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;

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

239 }
240
241 /*
242 * CPU == Platform
243 * platform is using soc-generic-dmaengine-pcm
244 */
245 priv->dai[i].cpus =
246 priv->dai[i].platforms = &dlc[0];
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;

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

239 }
240
241 /*
242 * CPU == Platform
243 * platform is using soc-generic-dmaengine-pcm
244 */
245 priv->dai[i].cpus =
246 priv->dai[i].platforms = &dlc[0];
247 priv->dai[i].codecs = &dlc[1];
247 priv->dai[i].codecs = &asoc_dummy_dlc;
248
249 priv->dai[i].num_cpus = 1;
250 priv->dai[i].num_codecs = 1;
251 priv->dai[i].num_platforms = 1;
252
253 priv->dai[i].name = dai_name;
254 priv->dai[i].stream_name = "HiFi-AUDMIX-FE";
248
249 priv->dai[i].num_cpus = 1;
250 priv->dai[i].num_codecs = 1;
251 priv->dai[i].num_platforms = 1;
252
253 priv->dai[i].name = dai_name;
254 priv->dai[i].stream_name = "HiFi-AUDMIX-FE";
255 priv->dai[i].codecs->dai_name = "snd-soc-dummy-dai";
256 priv->dai[i].codecs->name = "snd-soc-dummy";
257 priv->dai[i].cpus->of_node = args.np;
258 priv->dai[i].cpus->dai_name = dev_name(&cpu_pdev->dev);
259 priv->dai[i].dynamic = 1;
260 priv->dai[i].dpcm_playback = 1;
261 priv->dai[i].dpcm_capture = (i == 0 ? 1 : 0);
262 priv->dai[i].ignore_pmdown_time = 1;
263 priv->dai[i].ops = &imx_audmix_fe_ops;
264
265 /* Add AUDMIX Backend */
266 be_name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
267 "audmix-%d", i);
268 be_pb = devm_kasprintf(&pdev->dev, GFP_KERNEL,
269 "AUDMIX-Playback-%d", i);
270 be_cp = devm_kasprintf(&pdev->dev, GFP_KERNEL,
271 "AUDMIX-Capture-%d", i);
272
255 priv->dai[i].cpus->of_node = args.np;
256 priv->dai[i].cpus->dai_name = dev_name(&cpu_pdev->dev);
257 priv->dai[i].dynamic = 1;
258 priv->dai[i].dpcm_playback = 1;
259 priv->dai[i].dpcm_capture = (i == 0 ? 1 : 0);
260 priv->dai[i].ignore_pmdown_time = 1;
261 priv->dai[i].ops = &imx_audmix_fe_ops;
262
263 /* Add AUDMIX Backend */
264 be_name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
265 "audmix-%d", i);
266 be_pb = devm_kasprintf(&pdev->dev, GFP_KERNEL,
267 "AUDMIX-Playback-%d", i);
268 be_cp = devm_kasprintf(&pdev->dev, GFP_KERNEL,
269 "AUDMIX-Capture-%d", i);
270
273 priv->dai[num_dai + i].cpus = &dlc[2];
274 priv->dai[num_dai + i].codecs = &dlc[3];
271 priv->dai[num_dai + i].cpus = &dlc[1];
272 priv->dai[num_dai + i].codecs = &asoc_dummy_dlc;
275
276 priv->dai[num_dai + i].num_cpus = 1;
277 priv->dai[num_dai + i].num_codecs = 1;
278
279 priv->dai[num_dai + i].name = be_name;
273
274 priv->dai[num_dai + i].num_cpus = 1;
275 priv->dai[num_dai + i].num_codecs = 1;
276
277 priv->dai[num_dai + i].name = be_name;
280 priv->dai[num_dai + i].codecs->dai_name = "snd-soc-dummy-dai";
281 priv->dai[num_dai + i].codecs->name = "snd-soc-dummy";
282 priv->dai[num_dai + i].cpus->of_node = audmix_np;
283 priv->dai[num_dai + i].cpus->dai_name = be_name;
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

--- 65 unchanged lines hidden ---
278 priv->dai[num_dai + i].cpus->of_node = audmix_np;
279 priv->dai[num_dai + i].cpus->dai_name = be_name;
280 priv->dai[num_dai + i].no_pcm = 1;
281 priv->dai[num_dai + i].dpcm_playback = 1;
282 priv->dai[num_dai + i].dpcm_capture = 1;
283 priv->dai[num_dai + i].ignore_pmdown_time = 1;
284 priv->dai[num_dai + i].ops = &imx_audmix_be_ops;
285

--- 65 unchanged lines hidden ---