.. | .. |
---|
1 | | -/* |
---|
2 | | - * Copyright (C) 2013 Freescale Semiconductor, Inc. |
---|
3 | | - * |
---|
4 | | - * The code contained herein is licensed under the GNU General Public |
---|
5 | | - * License. You may obtain a copy of the GNU General Public License |
---|
6 | | - * Version 2 or later at the following locations: |
---|
7 | | - * |
---|
8 | | - * http://www.opensource.org/licenses/gpl-license.html |
---|
9 | | - * http://www.gnu.org/copyleft/gpl.html |
---|
10 | | - */ |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
---|
| 2 | +// |
---|
| 3 | +// Copyright (C) 2013 Freescale Semiconductor, Inc. |
---|
11 | 4 | |
---|
12 | 5 | #include <linux/module.h> |
---|
13 | 6 | #include <linux/of_platform.h> |
---|
.. | .. |
---|
22 | 15 | { |
---|
23 | 16 | struct device_node *spdif_np, *np = pdev->dev.of_node; |
---|
24 | 17 | struct imx_spdif_data *data; |
---|
| 18 | + struct snd_soc_dai_link_component *comp; |
---|
25 | 19 | int ret = 0; |
---|
26 | 20 | |
---|
27 | 21 | spdif_np = of_parse_phandle(np, "spdif-controller", 0); |
---|
.. | .. |
---|
32 | 26 | } |
---|
33 | 27 | |
---|
34 | 28 | data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); |
---|
35 | | - if (!data) { |
---|
| 29 | + comp = devm_kzalloc(&pdev->dev, 3 * sizeof(*comp), GFP_KERNEL); |
---|
| 30 | + if (!data || !comp) { |
---|
36 | 31 | ret = -ENOMEM; |
---|
37 | 32 | goto end; |
---|
38 | 33 | } |
---|
39 | 34 | |
---|
| 35 | + data->dai.cpus = &comp[0]; |
---|
| 36 | + data->dai.codecs = &comp[1]; |
---|
| 37 | + data->dai.platforms = &comp[2]; |
---|
| 38 | + |
---|
| 39 | + data->dai.num_cpus = 1; |
---|
| 40 | + data->dai.num_codecs = 1; |
---|
| 41 | + data->dai.num_platforms = 1; |
---|
| 42 | + |
---|
40 | 43 | data->dai.name = "S/PDIF PCM"; |
---|
41 | 44 | data->dai.stream_name = "S/PDIF PCM"; |
---|
42 | | - data->dai.codec_dai_name = "snd-soc-dummy-dai"; |
---|
43 | | - data->dai.codec_name = "snd-soc-dummy"; |
---|
44 | | - data->dai.cpu_of_node = spdif_np; |
---|
45 | | - data->dai.platform_of_node = spdif_np; |
---|
| 45 | + data->dai.codecs->dai_name = "snd-soc-dummy-dai"; |
---|
| 46 | + data->dai.codecs->name = "snd-soc-dummy"; |
---|
| 47 | + data->dai.cpus->of_node = spdif_np; |
---|
| 48 | + data->dai.platforms->of_node = spdif_np; |
---|
46 | 49 | data->dai.playback_only = true; |
---|
47 | 50 | data->dai.capture_only = true; |
---|
48 | 51 | |
---|
.. | .. |
---|
67 | 70 | goto end; |
---|
68 | 71 | |
---|
69 | 72 | ret = devm_snd_soc_register_card(&pdev->dev, &data->card); |
---|
70 | | - if (ret) { |
---|
| 73 | + if (ret && ret != -EPROBE_DEFER) |
---|
71 | 74 | dev_err(&pdev->dev, "snd_soc_register_card failed: %d\n", ret); |
---|
72 | | - goto end; |
---|
73 | | - } |
---|
74 | 75 | |
---|
75 | 76 | end: |
---|
76 | 77 | of_node_put(spdif_np); |
---|